mosamatic2 2.0.7__tar.gz → 2.0.9__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of mosamatic2 might be problematic. Click here for more details.
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/PKG-INFO +2 -1
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/pyproject.toml +2 -1
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/cli.py +2 -0
- mosamatic2-2.0.9/src/mosamatic2/commands/createdicomsummary.py +61 -0
- mosamatic2-2.0.9/src/mosamatic2/core/data/dicomimage.py +27 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/pipelines/defaultpipeline/defaultpipeline.py +4 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/createdicomsummarytask/createdicomsummarytask.py +3 -2
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/utils.py +22 -3
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/server.py +16 -0
- mosamatic2-2.0.9/src/mosamatic2/ui/resources/VERSION +1 -0
- mosamatic2-2.0.7/src/mosamatic2/core/data/dicomimage.py +0 -18
- mosamatic2-2.0.7/src/mosamatic2/ui/resources/VERSION +0 -1
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/README.md +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/models.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/app.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/commands/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/commands/calculatescores.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/commands/createpngsfromsegmentations.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/commands/dicom2nifti.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/commands/rescaledicomimages.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/commands/segmentmusclefatl3tensorflow.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/commands/selectslicefromscans.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/constants.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/data/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/data/dicomimageseries.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/data/dixonseries.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/data/filedata.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/data/multidicomimage.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/data/multinumpyimage.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/data/numpyimage.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/managers/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/managers/logmanager.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/managers/logmanagerlistener.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/pipelines/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/pipelines/defaultpipeline/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/pipelines/pipeline.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/singleton.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/calculatescorestask/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/calculatescorestask/calculatescorestask.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/createdicomsummarytask/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/createpngsfromsegmentationstask/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/createpngsfromsegmentationstask/createpngsfromsegmentationstask.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/dicom2niftitask/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/dicom2niftitask/dicom2niftitask.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/rescaledicomimagestask/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/rescaledicomimagestask/rescaledicomimagestask.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/segmentmusclefatl3tensorflowtask/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/segmentmusclefatl3tensorflowtask/paramloader.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/segmentmusclefatl3tensorflowtask/segmentmusclefatl3tensorflowtask.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/selectslicefromscanstask/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/selectslicefromscanstask/selectslicefromscanstask.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/task.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/mainwindow.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/resources/icons/mosamatic2.icns +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/resources/icons/mosamatic2.ico +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/resources/icons/spinner.gif +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/resources/images/body-composition.jpg +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/settings.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/utils.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/dialogs/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/dialogs/dialog.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/dialogs/helpdialog.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/defaultpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/logpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/mainpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/pipelines/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/pipelines/defaultpipelinepanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/pipelines/pipelinepanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/stackedpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/tasks/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/tasks/calculatescorestaskpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/tasks/createdicomsummarytaskpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/tasks/createpngsfromsegmentationstaskpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/tasks/dicom2niftitaskpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/tasks/rescaledicomimagestaskpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/tasks/segmentmusclefatl3tensorflowtaskpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/tasks/selectslicefromscanstaskpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/tasks/taskpanel.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/visualizations/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/visualizations/slicevisualization/__init__.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/visualizations/slicevisualization/custominteractorstyle.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/visualizations/slicevisualization/sliceviewer.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/visualizations/slicevisualization/slicevisualization.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/visualizations/visualization.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/splashscreen.py +0 -0
- {mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/worker.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: mosamatic2
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.9
|
|
4
4
|
Summary:
|
|
5
5
|
Author: Ralph Brecheisen
|
|
6
6
|
Author-email: r.brecheisen@maastrichtuniversity.nl
|
|
@@ -10,6 +10,7 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
10
10
|
Requires-Dist: antspyx (>=0.5.4)
|
|
11
11
|
Requires-Dist: dicom2nifti (>=2.6.2)
|
|
12
12
|
Requires-Dist: flask (>=3.1.2)
|
|
13
|
+
Requires-Dist: moosez
|
|
13
14
|
Requires-Dist: nibabel (>=5.3.2)
|
|
14
15
|
Requires-Dist: numpy (>=1.26.4)
|
|
15
16
|
Requires-Dist: openpyxl (>=3.1.5)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "mosamatic2"
|
|
3
|
-
version = "2.0.
|
|
3
|
+
version = "2.0.9"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Ralph Brecheisen", email = "r.brecheisen@maastrichtuniversity.nl"}
|
|
@@ -33,6 +33,7 @@ dependencies = [
|
|
|
33
33
|
"antspyx>=0.5.4",
|
|
34
34
|
"vtk>=9.5.1",
|
|
35
35
|
"pyqtgraph>=0.13.7",
|
|
36
|
+
"moosez",
|
|
36
37
|
]
|
|
37
38
|
|
|
38
39
|
[tool.poetry]
|
|
@@ -6,6 +6,7 @@ from mosamatic2.commands import (
|
|
|
6
6
|
createpngsfromsegmentations,
|
|
7
7
|
dicom2nifti,
|
|
8
8
|
selectslicefromscans,
|
|
9
|
+
createdicomsummary,
|
|
9
10
|
)
|
|
10
11
|
from mosamatic2.core.utils import show_doc_command
|
|
11
12
|
|
|
@@ -33,4 +34,5 @@ main.add_command(segmentmusclefatl3tensorflow.segmentmusclefatl3tensorflow)
|
|
|
33
34
|
main.add_command(createpngsfromsegmentations.createpngsfromsegmentations)
|
|
34
35
|
main.add_command(dicom2nifti.dicom2nifti)
|
|
35
36
|
main.add_command(selectslicefromscans.selectslicefromscans)
|
|
37
|
+
main.add_command(createdicomsummary.createdicomsummary)
|
|
36
38
|
main.add_command(show_doc_command(main)) # Special command to show long description for command
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import click
|
|
2
|
+
|
|
3
|
+
from mosamatic2.core.tasks import CreateDicomSummaryTask
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
@click.command(help='Creates a DICOM summary inside a root directory')
|
|
7
|
+
@click.option(
|
|
8
|
+
'--directory',
|
|
9
|
+
required=True,
|
|
10
|
+
type=click.Path(exists=True),
|
|
11
|
+
help='Root directory with DICOM images (can be multiple scans)',
|
|
12
|
+
)
|
|
13
|
+
@click.option(
|
|
14
|
+
'--output',
|
|
15
|
+
required=True,
|
|
16
|
+
type=click.Path(),
|
|
17
|
+
help='Output directory'
|
|
18
|
+
)
|
|
19
|
+
@click.option(
|
|
20
|
+
'--overwrite',
|
|
21
|
+
type=click.BOOL,
|
|
22
|
+
default=False,
|
|
23
|
+
help='Overwrite [true|false]'
|
|
24
|
+
)
|
|
25
|
+
def createdicomsummary(directory, output, overwrite):
|
|
26
|
+
"""
|
|
27
|
+
Creates a DICOM summary inside a root directory. Each patient should have
|
|
28
|
+
its own directory. Inside each patient's directory, there can be multiple
|
|
29
|
+
scans (called series) and multiple DICOM files per scan. The output of this
|
|
30
|
+
command is a file summary.txt (stored in the output directory) that contains
|
|
31
|
+
the following information:
|
|
32
|
+
|
|
33
|
+
- A list of patient directory names with the number of scans inside each
|
|
34
|
+
patient directory
|
|
35
|
+
- For each patient directory and scan directory the following information:
|
|
36
|
+
- Nr. of DICOM images in the scan
|
|
37
|
+
- Modality (e.g., CT or MRI)
|
|
38
|
+
- Image type (e.g., for Dixon scans can be in-phase, opposite-phase,
|
|
39
|
+
water or fat images)
|
|
40
|
+
- Rows/columns (size of the images)
|
|
41
|
+
- Pixel spacing (size of each pixel in mm^2)
|
|
42
|
+
- Slice thickness: (thickness of each image slice)
|
|
43
|
+
|
|
44
|
+
Parameters
|
|
45
|
+
----------
|
|
46
|
+
--directory : str
|
|
47
|
+
Root directory with patient directories, scans and DICOM images
|
|
48
|
+
|
|
49
|
+
--output : str
|
|
50
|
+
Path to output directory
|
|
51
|
+
|
|
52
|
+
--overwrite : bool
|
|
53
|
+
Overwrite contents output directory [true|false]
|
|
54
|
+
"""
|
|
55
|
+
task = CreateDicomSummaryTask(
|
|
56
|
+
inputs={'directory': directory},
|
|
57
|
+
params=None,
|
|
58
|
+
output=output,
|
|
59
|
+
overwrite=overwrite,
|
|
60
|
+
)
|
|
61
|
+
task.run()
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
from mosamatic2.core.data.filedata import FileData
|
|
2
|
+
from mosamatic2.core.utils import (
|
|
3
|
+
is_dicom,
|
|
4
|
+
load_dicom,
|
|
5
|
+
is_jpeg2000_compressed,
|
|
6
|
+
)
|
|
7
|
+
from mosamatic2.core.managers.logmanager import LogManager
|
|
8
|
+
|
|
9
|
+
LOG = LogManager()
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class DicomImage(FileData):
|
|
13
|
+
def load(self):
|
|
14
|
+
if self.path():
|
|
15
|
+
p = load_dicom(self.path())
|
|
16
|
+
if p:
|
|
17
|
+
if is_jpeg2000_compressed(p):
|
|
18
|
+
p.decompress()
|
|
19
|
+
self.set_object(p)
|
|
20
|
+
return True
|
|
21
|
+
# if is_dicom(self.path()):
|
|
22
|
+
# p = load_dicom(self.path())
|
|
23
|
+
# if is_jpeg2000_compressed(p):
|
|
24
|
+
# p.decompress()
|
|
25
|
+
# self.set_object(p)
|
|
26
|
+
# return True
|
|
27
|
+
return False
|
|
@@ -8,6 +8,9 @@ from mosamatic2.core.tasks import (
|
|
|
8
8
|
CreatePngsFromSegmentationsTask,
|
|
9
9
|
CalculateScoresTask,
|
|
10
10
|
)
|
|
11
|
+
from mosamatic2.core.managers.logmanager import LogManager
|
|
12
|
+
|
|
13
|
+
LOG = LogManager()
|
|
11
14
|
|
|
12
15
|
|
|
13
16
|
class DefaultPipeline(Pipeline):
|
|
@@ -25,6 +28,7 @@ class DefaultPipeline(Pipeline):
|
|
|
25
28
|
]
|
|
26
29
|
def __init__(self, inputs, params, output, overwrite):
|
|
27
30
|
super(DefaultPipeline, self).__init__(inputs, params, output, overwrite)
|
|
31
|
+
LOG.info('Found {} images to process'.format(len(os.listdir(self.input('images')))))
|
|
28
32
|
model_type = self.param('model_type')
|
|
29
33
|
# segmentation_task_class = SegmentMuscleFatL3Task if model_type == 'pytorch' else SegmentMuscleFatL3TensorFlowTask
|
|
30
34
|
segmentation_task_class = SegmentMuscleFatL3TensorFlowTask
|
|
@@ -25,8 +25,9 @@ class CreateDicomSummaryTask(Task):
|
|
|
25
25
|
for root, dirs, files in os.walk(patient_dir_path):
|
|
26
26
|
for f in files:
|
|
27
27
|
f_path = os.path.join(root, f)
|
|
28
|
-
if is_dicom(f_path):
|
|
29
|
-
|
|
28
|
+
# if is_dicom(f_path):
|
|
29
|
+
p = load_dicom(f_path, stop_before_pixels=True)
|
|
30
|
+
if p:
|
|
30
31
|
series_instance_uid = p.SeriesInstanceUID
|
|
31
32
|
if not series_instance_uid in data[patient_dir_name].keys():
|
|
32
33
|
data[patient_dir_name][series_instance_uid] = []
|
|
@@ -14,10 +14,12 @@ from pydicom.uid import (
|
|
|
14
14
|
ExplicitVRLittleEndian, ImplicitVRLittleEndian, ExplicitVRBigEndian
|
|
15
15
|
)
|
|
16
16
|
from PIL import Image
|
|
17
|
+
from mosamatic2.core.managers.logmanager import LogManager
|
|
17
18
|
|
|
18
19
|
warnings.filterwarnings("ignore", message="Invalid value for VR UI:", category=UserWarning)
|
|
19
20
|
|
|
20
21
|
MUSCLE, VAT, SAT = 1, 5, 7
|
|
22
|
+
LOG = LogManager()
|
|
21
23
|
|
|
22
24
|
|
|
23
25
|
def create_name_with_timestamp(prefix: str='') -> str:
|
|
@@ -102,17 +104,34 @@ def is_dicom(f):
|
|
|
102
104
|
pydicom.dcmread(f, stop_before_pixels=True)
|
|
103
105
|
return True
|
|
104
106
|
except pydicom.errors.InvalidDicomError:
|
|
105
|
-
|
|
107
|
+
try:
|
|
108
|
+
pydicom.dcmread(f, stop_before_pixels=True, force=True)
|
|
109
|
+
return True
|
|
110
|
+
except pydicom.errors.InvalidDicomError:
|
|
111
|
+
pass
|
|
112
|
+
return False
|
|
106
113
|
|
|
107
114
|
|
|
108
115
|
def load_dicom(f, stop_before_pixels=False):
|
|
109
|
-
|
|
116
|
+
try:
|
|
110
117
|
return pydicom.dcmread(f, stop_before_pixels=stop_before_pixels)
|
|
118
|
+
except pydicom.errors.InvalidDicomError:
|
|
119
|
+
try:
|
|
120
|
+
p = pydicom.dcmread(f, stop_before_pixels=stop_before_pixels, force=True)
|
|
121
|
+
if hasattr(p, 'SOPClassUID'):
|
|
122
|
+
if not hasattr(p.file_meta, 'TransferSyntaxUID'):
|
|
123
|
+
LOG.warning(f'DICOM file {f} does not have FileMetaData/TransferSyntaxUID, trying to fix...')
|
|
124
|
+
p.file_meta.TransferSyntaxUID = pydicom.uid.ImplicitVRLittleEndian
|
|
125
|
+
return p
|
|
126
|
+
except pydicom.errors.InvalidDicomError:
|
|
127
|
+
pass
|
|
111
128
|
return None
|
|
112
129
|
|
|
113
130
|
|
|
114
131
|
def is_jpeg2000_compressed(p):
|
|
115
|
-
|
|
132
|
+
if hasattr(p.file_meta, 'TransferSyntaxUID'):
|
|
133
|
+
return p.file_meta.TransferSyntaxUID not in [ExplicitVRLittleEndian, ImplicitVRLittleEndian, ExplicitVRBigEndian]
|
|
134
|
+
return False
|
|
116
135
|
|
|
117
136
|
|
|
118
137
|
def is_numpy_array(value):
|
|
@@ -7,6 +7,7 @@ from mosamatic2.core.tasks import CalculateScoresTask
|
|
|
7
7
|
from mosamatic2.core.tasks import CreatePngsFromSegmentationsTask
|
|
8
8
|
from mosamatic2.core.tasks import Dicom2NiftiTask
|
|
9
9
|
from mosamatic2.core.tasks import SelectSliceFromScansTask
|
|
10
|
+
from mosamatic2.core.tasks import CreateDicomSummaryTask
|
|
10
11
|
|
|
11
12
|
app = Flask(__name__)
|
|
12
13
|
|
|
@@ -122,6 +123,21 @@ def run_selectslicefromscans():
|
|
|
122
123
|
return 'PASSED'
|
|
123
124
|
|
|
124
125
|
|
|
126
|
+
@app.route('/createdicomsummary')
|
|
127
|
+
def run_createdicomsummary():
|
|
128
|
+
directory = request.args.get('directory')
|
|
129
|
+
output = request.args.get('output')
|
|
130
|
+
overwrite = request.args.get('overwrite', default=True, type=bool)
|
|
131
|
+
task = CreateDicomSummaryTask(
|
|
132
|
+
inputs={'directory': directory},
|
|
133
|
+
params=None,
|
|
134
|
+
output=output,
|
|
135
|
+
overwrite=overwrite,
|
|
136
|
+
)
|
|
137
|
+
task.run()
|
|
138
|
+
return 'PASSED'
|
|
139
|
+
|
|
140
|
+
|
|
125
141
|
def main():
|
|
126
142
|
parser = argparse.ArgumentParser()
|
|
127
143
|
parser.add_argument('--port', type=int, default=constants.MOSAMATIC2_SERVER_PORT)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
2.0.9
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
from mosamatic2.core.data.filedata import FileData
|
|
2
|
-
from mosamatic2.core.utils import (
|
|
3
|
-
is_dicom,
|
|
4
|
-
load_dicom,
|
|
5
|
-
is_jpeg2000_compressed,
|
|
6
|
-
)
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
class DicomImage(FileData):
|
|
10
|
-
def load(self):
|
|
11
|
-
if self.path():
|
|
12
|
-
if is_dicom(self.path()):
|
|
13
|
-
p = load_dicom(self.path())
|
|
14
|
-
if is_jpeg2000_compressed(p):
|
|
15
|
-
p.decompress()
|
|
16
|
-
self.set_object(p)
|
|
17
|
-
return True
|
|
18
|
-
return False
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
2.0.7
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/commands/createpngsfromsegmentations.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/commands/segmentmusclefatl3tensorflow.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/pipelines/defaultpipeline/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/calculatescorestask/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/createdicomsummarytask/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/dicom2niftitask/dicom2niftitask.py
RENAMED
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/rescaledicomimagestask/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/core/tasks/selectslicefromscanstask/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/resources/images/body-composition.jpg
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/pipelines/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/pipelines/pipelinepanel.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/tasks/dicom2niftitaskpanel.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mosamatic2-2.0.7 → mosamatic2-2.0.9}/src/mosamatic2/ui/widgets/panels/visualizations/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|