Please add cropping and padding options to maskVolume effect in ExtraEffect tools

It is common in our field to stuff whole bunch of genetically samples into the same scan to cut down the scanning costs/time (eg 10-15 zebrafish from the same clutch).

We are training our folks to use Slicer to do a quick segmentation to mask and save these specimen as individual datasets for further analysis.

Grow from the seeds and masking works really well in this context. What is missing is an option to cut down the original volume size to the largest extends of the mask and add an option to pad the cropped image. Of course this can be done with already existing tools in Slicer, but from a workflow point of view this might be a useful addition to the existing maskVolume functionality in the SegmentEditorExtraEffects extension.

I see how such a Segment Editor effect could be useful. It is quite a niche use case, so I don’t think I could allocate time to work on it but maybe you could give it a try and implement it. “Mask volume” effect in SegmentEditorExtraEffects extension is quite similar. You just need to modify it to compute the extent from the segment (similarly to how it is done here).

@muratmaga maybe if you provided a sample dataset with scan and segmentations so we could get an idea what it would look like. It sounds like this could be just a few lines of numpy code.

-Steve

I think @smrolfe is close getting ready for a pull request to add this as an CropSegment effective to segementeditorextraeffects i believe.

1 Like

Great! If it’s a completely generic tool then SegmentEditorExtraEffects is a good home for it. If this new effect is tailored for needs of morpho community then you may distribute it in SlicerMorpho extension.

1 Like

Hi @lassoan, its a completely generic tool that uses the current segment to mask and crop to the segment extent, with an option to add padding.

@muratmaga , I’ve uploaded the extension to your repository for testing.

Sounds like a good fit for SegmentEditorExtraEffects extension then!

1 Like

Thanks @lassoan, I have just submitted the pull request.