Skip to content

Commit

Permalink
Reorganized code structure for packaging
Browse files Browse the repository at this point in the history
All the source has moved into the dicom2stl sub-dir.

parseargs.py has moved into dicom2stl/utils

The main script has been renamed to Dicom2STL.py to disambiguate
it from the dicom2stl package.  And the main function has been
renamed to Dicom2STL.
  • Loading branch information
dave3d committed Feb 28, 2024
1 parent 90ae1ea commit c09c3aa
Show file tree
Hide file tree
Showing 15 changed files with 29 additions and 13 deletions.
1 change: 0 additions & 1 deletion __init__.py

This file was deleted.

12 changes: 6 additions & 6 deletions dicom2stl.py → dicom2stl/Dicom2STL.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@

from SimpleITK.utilities.vtk import sitk2vtk

import parseargs
import dicom2stl

from glob import glob

from utils import dicomutils
from utils import vtkutils
from dicom2stl.utils import dicomutils
from dicom2stl.utils import vtkutils


def roundThousand(x):
Expand Down Expand Up @@ -297,7 +297,7 @@ def getTissueThresholds(tissueType):
return thresholds, medianFilter


def dicom2stl(args):
def Dicom2STL(args):
# Global variables
#
thresholds = []
Expand Down Expand Up @@ -428,8 +428,8 @@ def dicom2stl(args):


def main():
args = parseargs.parseargs()
dicom2stl(args)
args = dicom2stl.utils.parseargs.parseargs()
Dicom2STL(args)

if __name__ == "__main__":
main()
7 changes: 7 additions & 0 deletions dicom2stl/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import dicom2stl.utils.parseargs
import dicom2stl.Dicom2STL
def main():
"""Entry point for the application script"""
print("Call your main application code here")
args = parseargs.parseargs()
dicom2stl_func.Dicom2STL(args)
7 changes: 7 additions & 0 deletions dicom2stl/__init__.py~
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import dicom2stl.utils.parseargs
import dicom2stl.dicom2stl_func
def main():
"""Entry point for the application script"""
print("Call your main application code here")
args = parseargs.parseargs()
dicom2stl_func.dicom2stl_func(args)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ dynamic = ["dependencies", "version"]
[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}

[tool.setuptools.packages.find]
exclude = ["docs*", "tests*", "binder*", "utils*", "examples*"]

[project.scripts]
dicom2stl = "dicom2stl:main"
dicom2stl = "Dicom2STL:main"

[tool.setuptools_scm]
local_scheme = "dirty-tag"
Expand Down
6 changes: 3 additions & 3 deletions tests/test_dicom2stl.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import os

import SimpleITK as sitk
import parseargs
import dicom2stl
from dicom2stl.utils import parseargs
from dicom2stl.Dicom2STL import Dicom2STL

from tests import create_data

Expand Down Expand Up @@ -34,7 +34,7 @@ def test_dicom2stl(self):
print(args)

try:
dicom2stl.dicom2stl(args)
Dicom2STL(args)
except BaseException:
self.fail("dicom2stl: exception thrown")

Expand Down
2 changes: 1 addition & 1 deletion tests/test_dicomutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import SimpleITK as sitk
from tests import create_data
from tests import write_series
from utils import dicomutils
from dicom2stl.utils import dicomutils


class TestDicomUtils(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_vtkutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import SimpleITK as sitk
import create_data
import vtk
from utils import vtkutils
from dicom2stl.utils import vtkutils


class TestVTKUtils(unittest.TestCase):
Expand Down

0 comments on commit c09c3aa

Please sign in to comment.