Hello to anyone,
I got an origin inconsistent problem. I defined 3D volume origin as (0,0,0) in NIFTI image file, however, when imported into ITK-snap software, its origin show as (-0.5, -0.5, 0.5). I would like to ask how this happened and how to fix this problem.
Here is the detail of the problem:
I used MATLAB "Tools for NIfTI and ANALYZE image" to create an example Nifti file, like this:
voxel_size = [0.5,0.5,0.5];
origin = [0,0,0]; % In make_nii file, it said this is AC origin, I would like to ask what is AC?
nii = make_nii(bb.img,voxel_size,origin,datatype);
save_nii(nii,'test.nii');
Its header information .hdr result shows like this:
A better view of 'test.nii' header information in cmd is here:
However, when importing 'test.nii' into ITK-snap 3.8 software, image information show like this:
Origin changed from (0,0,0) to (-0.5, -0.5, 0.5). I would like to consult how this result come in ITK-snap, that bounding box calculation, and what should I do to correct this problem?
Solved it myself by modifying srow_x/y/z matrix, origin input is voxel coordinate instead of world coordinate, and Nifti Image format orientation is different from the ITK
Hello to anyone, I got an origin inconsistent problem. I defined 3D volume origin as (0,0,0) in NIFTI image file, however, when imported into ITK-snap software, its origin show as (-0.5, -0.5, 0.5). I would like to ask how this happened and how to fix this problem.
Here is the detail of the problem:
I used MATLAB "Tools for NIfTI and ANALYZE image" to create an example Nifti file, like this:
voxel_size = [0.5,0.5,0.5]; origin = [0,0,0]; % In make_nii file, it said this is AC origin, I would like to ask what is AC? nii = make_nii(bb.img,voxel_size,origin,datatype); save_nii(nii,'test.nii');
Its header information .hdr result shows like this:
A better view of 'test.nii' header information in cmd is here:
However, when importing 'test.nii' into ITK-snap 3.8 software, image information show like this:
Origin changed from (0,0,0) to (-0.5, -0.5, 0.5). I would like to consult how this result come in ITK-snap, that bounding box calculation, and what should I do to correct this problem?