Effect of changing ".nrrd" size to annotation (ROI bounding box)

Operating system: Windows
Slicer version: 4.11

I used 3D slicer to annotate (Using ROI) some DICOM images and saved them as “.nrrd” file and annotation as “.acsv”. I have attached an image below. The “.nrrd” has a size of 512x512x158 and the bounding box (annotation) has the following parameters “point|12.8546|219.402|128.809|1|1 (center of the box); point|7.72059|5.88235|4.0311|1|1 (length of each axis)”.
If I change the size of “.nrrd” to 128x128x128 before training them in the neural network, should I change the annotation parametrs too? What effect does changing the “.nrrd” size has on the annotation (bounding box parameters)?
My goal is to make a detection algorithm (to find the region of interest in the neuroimage).

Slicer coordinates are in patient space, so if you resize the image you need to take that into account in your code. This page describes the matrices involved.

https://www.slicer.org/wiki/Coordinate_systems

1 Like

Thank you @pieper . The problem is that I am using data from two different scanner. One produces 158 slices, and the other produces 190 slices. So half of my “.nrrd” has a size of 512x512x158 and the rest has 512x512x190. Do you think I should resize them to a common size and change the annotation accordingly or is there some easier way?

They will probably all have slightly different pixel sizes or at least slice spacings so if you need them all to be in the same pixel grid then you need to resample them to you are sure to take that into account (or the anatomy will get distorted). The Resample Scalar/Vector/DWI module lets you resample one image into the space of another, optionally through a transform.

1 Like

Great! Let’s say, I want to rescale them to a common spacing of 0.40x0.40x0.40 mm^3. Then crop them to 128x128x128 pixels before feeding them into the neural network. Is this a valid way?

That sound generally reasonable yes. You might need to do some level of registration so that they are roughly aligned and you might also want to look at SlicerTorchIO to generate augmentation data.

2 Likes