Create cubic ROI (VOI) and extract data from image file (e.g MRI)?

I want to draw/create a cubic VOI of 1cm x 1cm x 0.5cm, I haven’t found the right tool in editor/segment editor??
Furthermore I want to place this VOI into a MRI image and save this VOI (but including the dimensions of the original MRI data set. i.e. I assume the VOI needs to be transformed based on the dimensions of the MRI).
Last but not least is there an option to extract the image content of the VOI box?

kind regards

You can create a model node of such a box (using “Create models” module of SlicerIGT extension or a few-line python script). Then translate/rotate using a transform node (you can use interactive widget in 3D views - can be enabled in Transforms module; or using markups points, lines, etc).

There are several examples in the Python script repository that you can use, if you want to create automated/customized tools.

Thank you for your fast reply!!!
However I fail to see/rotate the 3d cube on the dicom image (after I set the cube to transform under Transforms). Is there a chance to change to colour of the cube (or can it be only done in python?)

You can always easily change the color of the cube by clicking on the node color icon and selecting the desired color.

After you applied the transform to the cube, you can use Transforms module’s sliders to change the transformation or enable “Visible in 3D view” option and translate rotate interactively in the 3D view.

Thank you for your replies!
Unfortunately I still fail to extract the ROIs:

  1. Is there a difference between creating a ROI or creating a cube using the ITK Modul? Because if it is a surface mesh maybe thats the problem, as I actually only want to extract the MRI data of this specifc cube (=ROI)
  2. After I have positioned my cube using the the transforms tool:
    I have to convert it afterwards? reference vol=my MRI data, output displacement field=new transform as?->Apply?
    3)From the data modul I should then be able to export this transformed cube as dicom, which is not working for me at all

I am looking for an option where I can create a mask of the MRI file (like in FSL), create my ROI in this mask and save this mask with the original MRI dimension and including my ROI (like a binary mask). Later it would be great to just extract the MRI data within this cube.
I further want to place multiple ROIs in one mask and calculate distances (distance transformation) and apply a transformation matrix on this mask?
Is there a chance to solve this in slicer?

kind regards

You can import a model of the right shape and size into segmentation node, then export it as labelmap, using the MRI file as reference volume. You can blank out areas outside the segment using Mask Volume effect.

If you want to do this to register segments then you can do this directly using Segment Registration extension. It computes the distance maps, registers them, and returns the resulting transform (linear or deformable). If you want to do this to compute Hausdorff distance or other error statistics then you can use Segment Comparison module.

Thank you for your great efforts you put in the slicer project!!

That was exactly what I was looking for!

I have tried out different settings (knowing that the original voxel dimensions of the MRI matters in this context)

  • simply exporting the label map provides the best results (i.e. nearest design of a cube with only minor edges and overhangs)
  • mask volume effect: much more edges and overhangs
  • model to labelmap node (which I thought could even fasten the process) does not improve segmentation whether standard setting of 1.0 or lower of 0.1 is used and is not as good as the first method
    main problem with this node: despite the fact that the cube is transformed, it always uses the original centered version?

Do you have any recommendations how I could improve segmentation in order to get an almost perfect cube with only minor deviations along its faces/sides?

Are there any recommendations for obtaining best results when segmenting MRI data?
the segmented cube has so many edges even though I rescaled the volume using bspline:
the original voxels are: 0.7, 0.7, 0.8
So I thought rescaling to 0.8, 0.8, 0.8 using bspline would help but it does not.
I do not understand why segmentations ob a cube results in so many edges (figure 2)?Bildschirmfoto 2020-03-01 um 16.23.21

Is the resolution of the MRI still to low to obtain a more detailed cube (as depicted in the figure 1)

How large is the cube? To get smooth edges, you need to have at least 50-100 voxels along the edge of the cube.

the cube I tested is 10mm x 10mm x 10mm, however I tend to use one of 15mm x 10mm x 5mm for my study

btw: I tried oversampling the label map (specify geometry) and resampling the mri volume to 0.1 bspline and both not really improved the final labelmap

This is expected then. Your whole volume was about 12x12x12 voxels. If you resample the input volume (not the exported labelmap) before you start segmentation to make voxel size about 0.1mm then edges of the cube will be smooth.