Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(1) was hitting permission error when overwriting ~/../segmentations/converted_dcm.nii.gz
added this to spine.py:
if self.save:
# Save spine segmentation
seg_path = os.path.join(
inference_pipeline.output_dir, "segmentations", "spine.nii.gz"
)
# remove stale file & ensure directory exists
if os.path.exists(seg_path):
os.remove(seg_path)
os.makedirs(os.path.dirname(seg_path), exist_ok=True)
nib.save(segmentation, seg_path)
(2)
in aaa.py:
In class AortaSegmentation.call
added line: inference_pipeline.dicom_series_path = inference_pipeline.input_path
also added: print("DICOM series path is:", inference_pipeline.input_path) for debug
in inference_pipeline.py:
added: def call(self, inference_pipeline=None, input_path: str = None, **kwargs):
and added:
# pick whether we're writing onto self or the wrapped pipeline
target = inference_pipeline or self
in process.py:
added: pipeline(input_path=path, output_dir=output_dir, model_dir=model_dir)
(3)
changed C2C AAA-pipeline builder code to:
def AAAPipelineBuilder(path, args):
# build the "crop" pipeline and pull out its step‐classes
crop_pipeline = AxialCropperPipelineBuilder(path, args)
# now concatenate its classes with the AAA steps
classes = crop_pipeline.inference_classes + [
aaa.AortaSegmentation(),
aaa.AortaDiameter(),
aaa.AortaMetricsSaver(),
]
return InferencePipeline(classes)
(4)
made this change in aaa.py: