Issue with c3d -region for single label file vs img file?

16 views
Skip to first unread message

mfk16

unread,
Apr 14, 2024, 11:12:50 AMApr 14
to itksnap-users
Hi,

I'm trying to crop down a full 3D image to an ROI that's defined by a single label (row x col x 3 slices).

I'm using c3d with the -region flag and I'm using with the same bounding box for the image (int16) and the single label file (uint16).

When I view the single label in the full image, it's displayed properly on 3 slices (with a given row x col coverage).

When I run the c3d -region command on the image, I get out a file that corresponds to the anticipated bounding box (rows x cols) and the file is 3 slices, again which is expected.

However, when I run the c3d -region command on the single label file, using the same values for vOrigin and vSize as I did with the image file, I get out an image of anticipated bounding box size, but the label is only on 2 of the 3 slices.

I figured I did something when typing the command for the label file as compared to the img file, so I simply swapped filenames, but I still got the same results. I also confirmed the appropriate '-type'.

For what it's worth, I have confirmed the image dimensions, bounding box, voxel spacing, canon orientation dir cos matrix and voxel transform is identical between the file that's a full image and the file that's the ROI idefined by a single label 

Are there any suggestions on how to resolve as I'd like to preserve the image space coordinate system?

Thank you,

Matt

mfk16

unread,
Apr 14, 2024, 9:15:50 PMApr 14
to itksnap-users
Well,

I was able to answer my own question...I had to subtract each entry of vOrigin  by 1 to get to the 'real' starting point in my image, then everything worked perfectly.

Thanks.
Reply all
Reply to author
Forward
0 new messages