Reputation: 1835
I have a whole-body MRI scans with the header below:
{
dim : [ 3 320 260 96 1 0 0 0]
pixdim : [1. 1.40625 1.40625 3. 0.00436 0. 0. 0. ]
qoffset_x : -216.09375
qoffset_y : -178.90625
qoffset_z : -664.5
srow_x : [ 1.40625 0. 0. -216.09375]
srow_y : [ 0. 1.40625 0. -178.90625]
srow_z : [ 0. 0. 3. -664.5]
}
Binary label-maps
for different organs in the whole-body MRI scan. I need to merge them together as a single label-map nifty file.
One of the label-map
has a different shape and q_offset values in its header that make merging difficult. The header of that label-map nifty file below:
{
dim : [ 3 55 49 28 1 1 1 1]
pixdim : [1. 1.40625 1.40625 3. 1. 1. 1. 1. ]
qoffset_x : 119.41935
qoffset_y : 106.36636
qoffset_z : -503.68216
srow_x : [ -1.40625 0. 0. 119.41935]
srow_y : [ 0. -1.40625 0. 106.36636]
srow_z : [ 0. 0. 3. -503.68216]
}
When I overlay the individual label-map on top of the whole-body MRI scan using 3dSlicer
, it overlayed perfectly for the concerned organ, but as the shape is different, once after merging all label-maps, it does not work [ Yellow label-map for Spleen organ].
This is how it looks in 3dSlicer
[ Look for Yellow region.].
But the expected area of visualization is in the bottom right of below pic. (Spleen Organ)
As the voxel resolution is the same, I think this has something to do with different q_offset
values.
Kindly, let me know if anyone has a solution.
Upvotes: 3
Views: 978
Reputation: 2480
It depends on what your program for viewing / post-processing requires.
Some programs need the resolutions to be the same (which is not true in your case), but then may allow different Q/S-forms (when they are not used).
Others allow you to overlay images with different resolutions, but then rely on the Q/S forms to position the images in the view box.
One interesting thing in your nifti headers is that the x and y voxel sizes in the S-form are positive in the scan and negative in the labels.
That means:
and
As your viewer seems to take the Q/S-forms into account, that would mean that the voxel data themselves are swapped in both directions. But that also means that the centres of gravity may need adjusting (in one case: offsets are from the left/front, in the other case from the right/back).
You can test that with a copy of your file where the new offsets are changed. The S-form does look like the labels have been aligned (the offsets are greater than the extents of the bounding box) but maybe not with a tool that handles images with different LR and AP orientations well.
Upvotes: 0