Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Packaging for PyPI #60

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions dicom2stl.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def elapsedTime(start_time):
print(" %4.3f seconds" % dt)


def loadVolume(fname, tempDir=None, verbose=False):
def loadVolume(fname, tempDir=None, verbose=0):
modality = None
zipFlag = False
dirFlag = False
Expand Down Expand Up @@ -85,7 +85,7 @@ def loadVolume(fname, tempDir=None, verbose=False):
#
if zipFlag:
# Case for a zip file of images
if args.verbose:
if verbose:
print("zip")
if not tempDir:
with tempfile.TemporaryDirectory() as defaultTempDir:
Expand Down Expand Up @@ -120,8 +120,8 @@ def extract_int(file_path):

fname = sorted(fname, key=extract_int)

if args.verbose:
if args.verbose > 1:
if verbose:
if verbose > 1:
print("Reading images: ", fname)
else:
print(
Expand Down Expand Up @@ -427,6 +427,9 @@ def dicom2stl(args):
print("")


if __name__ == "__main__":
def main():
args = parseargs.parseargs()
dicom2stl(args)

if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ name = "dicom2stl"
authors = [
{ name="David Chen", email="dchen@mail.nih.gov" },
]
description = "A script to extract an STL surface mesh from a DICOM volume image."
description = "A script to extract an iso-surface from a DICOM series to produce an STL mesh."
readme = "README.md"
requires-python = ">=3.8"
classifiers = [
Expand Down