open-discussion > Error while opening MRIcron drawn lesion files in Tracvis as an ROI
Showing 1-6 of 6 posts
Aug 24, 2020 04:08 PM | PRABHAKAR AT - Christian Medical College and Hospital
Error while opening MRIcron drawn lesion files in Tracvis as an ROI
We have been working on lesion based studies where we now wish to
do structural connectivity analysis using Trackvis and
BCBtoolkit.
We have data sets of 70 - 80 patients with manually drawn lesions using MRIcron. The main problem we discovered was that while we tried using Trackvis, we found that our lesion files could be be loaded as ROI in trackvis.
Though both the image types were NIFTI1, we realised that in MRIcron the data gets saved as data-type - uInt 8 and the form that Trackvis is able to read is data_type float32. Though we wrote python codes to change the data type , we still found that the lesions were not being read.
Another difference in the two file types was that the image affine and dim was different for both the files.
We tried changing the affine and the header info- despite this we were unable to solve the problem.
we were wondering if there a method for converting the MRIcron drawn lesions files to ROIs that can be opened in trackvis
The header information of both types of the lesion files below.
Header information from a lesion file drawn manually on Trackvis
sizeof_hdr : 348
data_type : b''
db_name : b''
extents : 0
session_error : 0
regular : b'r'
dim_info : 0
dim : [ 3 182 218 182 1 0 0 0]
intent_p1 : 0.0
intent_p2 : 0.0
intent_p3 : 0.0
intent_code : none
datatype : float32
bitpix : 32
slice_start : 0
pixdim : [-1. 1. 1. 1. 0. 0. 0. 0.]
vox_offset : 0.0
scl_slope : nan
scl_inter : nan
slice_end : 0
slice_code : unknown
xyzt_units : 10
cal_max : 0.0
cal_min : 0.0
slice_duration : 0.0
toffset : 0.0
glmax : 0
glmin : 0
descrip : b''
aux_file : b''
qform_code : scanner
sform_code : unknown
quatern_b : 0.0
quatern_c : 1.0
quatern_d : 0.0
qoffset_x : 90.0
qoffset_y : -126.0
qoffset_z : -72.0
srow_x : [0. 0. 0. 0.]
srow_y : [0. 0. 0. 0.]
srow_z : [0. 0. 0. 0.]
intent_name : b''
magic : b'n+1'
Details of the image affine
[[ -1. 0. 0. 90.]
[ 0. 1. 0. -126.]
[ 0. 0. 1. -72.]
[ 0. 0. 0. 1.]]
Header information from a lesion file drawn manually on MRIcron
sizeof_hdr : 348
data_type : b'dsr '
db_name : b'/home/john/data/n'
extents : 0
session_error : 0
regular : b'r'
dim_info : 0
dim : [ 3 181 217 181 1 1 1 1]
intent_p1 : 0.0
intent_p2 : 0.0
intent_p3 : 0.0
intent_code : none
datatype : uint8
bitpix : 8
slice_start : 0
pixdim : [1. 1. 1. 1. 0. 0. 0. 0.]
vox_offset : 0.0
scl_slope : nan
scl_inter : nan
slice_end : 0
slice_code : unknown
xyzt_units : 0
cal_max : 0.0
cal_min : 0.0
slice_duration : 0.0
toffset : 0.0
glmax : 255
glmin : 0
descrip : b'spm - algebra'
aux_file : b'none '
qform_code : unknown
sform_code : mni
quatern_b : 1.0
quatern_c : 0.0
quatern_d : 0.0
qoffset_x : 0.0
qoffset_y : 0.0
qoffset_z : 0.0
srow_x : [ 1. 0. 0. -90.]
srow_y : [ 0. 1. 0. -125.]
srow_z : [ 0. 0. 1. -71.]
intent_name : b''
magic : b'n+1'
Details of the Image Affine
[[ 1. 0. 0. -90.]
[ 0. 1. 0. -125.]
[ 0. 0. 1. -71.]
[ 0. 0. 0. 1.]]
We have data sets of 70 - 80 patients with manually drawn lesions using MRIcron. The main problem we discovered was that while we tried using Trackvis, we found that our lesion files could be be loaded as ROI in trackvis.
Though both the image types were NIFTI1, we realised that in MRIcron the data gets saved as data-type - uInt 8 and the form that Trackvis is able to read is data_type float32. Though we wrote python codes to change the data type , we still found that the lesions were not being read.
Another difference in the two file types was that the image affine and dim was different for both the files.
We tried changing the affine and the header info- despite this we were unable to solve the problem.
we were wondering if there a method for converting the MRIcron drawn lesions files to ROIs that can be opened in trackvis
The header information of both types of the lesion files below.
Header information from a lesion file drawn manually on Trackvis
sizeof_hdr : 348
data_type : b''
db_name : b''
extents : 0
session_error : 0
regular : b'r'
dim_info : 0
dim : [ 3 182 218 182 1 0 0 0]
intent_p1 : 0.0
intent_p2 : 0.0
intent_p3 : 0.0
intent_code : none
datatype : float32
bitpix : 32
slice_start : 0
pixdim : [-1. 1. 1. 1. 0. 0. 0. 0.]
vox_offset : 0.0
scl_slope : nan
scl_inter : nan
slice_end : 0
slice_code : unknown
xyzt_units : 10
cal_max : 0.0
cal_min : 0.0
slice_duration : 0.0
toffset : 0.0
glmax : 0
glmin : 0
descrip : b''
aux_file : b''
qform_code : scanner
sform_code : unknown
quatern_b : 0.0
quatern_c : 1.0
quatern_d : 0.0
qoffset_x : 90.0
qoffset_y : -126.0
qoffset_z : -72.0
srow_x : [0. 0. 0. 0.]
srow_y : [0. 0. 0. 0.]
srow_z : [0. 0. 0. 0.]
intent_name : b''
magic : b'n+1'
Details of the image affine
[[ -1. 0. 0. 90.]
[ 0. 1. 0. -126.]
[ 0. 0. 1. -72.]
[ 0. 0. 0. 1.]]
Header information from a lesion file drawn manually on MRIcron
sizeof_hdr : 348
data_type : b'dsr '
db_name : b'/home/john/data/n'
extents : 0
session_error : 0
regular : b'r'
dim_info : 0
dim : [ 3 181 217 181 1 1 1 1]
intent_p1 : 0.0
intent_p2 : 0.0
intent_p3 : 0.0
intent_code : none
datatype : uint8
bitpix : 8
slice_start : 0
pixdim : [1. 1. 1. 1. 0. 0. 0. 0.]
vox_offset : 0.0
scl_slope : nan
scl_inter : nan
slice_end : 0
slice_code : unknown
xyzt_units : 0
cal_max : 0.0
cal_min : 0.0
slice_duration : 0.0
toffset : 0.0
glmax : 255
glmin : 0
descrip : b'spm - algebra'
aux_file : b'none '
qform_code : unknown
sform_code : mni
quatern_b : 1.0
quatern_c : 0.0
quatern_d : 0.0
qoffset_x : 0.0
qoffset_y : 0.0
qoffset_z : 0.0
srow_x : [ 1. 0. 0. -90.]
srow_y : [ 0. 1. 0. -125.]
srow_z : [ 0. 0. 1. -71.]
intent_name : b''
magic : b'n+1'
Details of the Image Affine
[[ 1. 0. 0. -90.]
[ 0. 1. 0. -125.]
[ 0. 0. 1. -71.]
[ 0. 0. 0. 1.]]
Feb 14, 2022 12:02 PM | cui zhixia
RE: Error while opening MRIcron drawn lesion files in Tracvis as an ROI
Hi,
I am a novice. I can't answer your question. I also need your help. I would like to know the detailed steps of how to manually draw ROI with mricon.
With kind regards,
Cui Zhixia
I am a novice. I can't answer your question. I also need your help. I would like to know the detailed steps of how to manually draw ROI with mricon.
With kind regards,
Cui Zhixia
Feb 14, 2022 02:02 PM | Chris Rorden
RE: Error while opening MRIcron drawn lesion files in Tracvis as an ROI
Cui Zhixia
You can see details on drawing a lesion with MRIcron here:
https://people.cas.sc.edu/rorden/mricron/stats.html
While I am happy that my legacy tools have proved popular and robust, I have heavy teaching, admin, service and research loads. I have prioritized my efforts on the more recent MRIcroGL. You may want to try that out.
https://www.nitrc.org/plugins/mwiki/index.php/mricrogl:MainPage#Drawing_Regions_of_Interest
You can see details on drawing a lesion with MRIcron here:
https://people.cas.sc.edu/rorden/mricron/stats.html
While I am happy that my legacy tools have proved popular and robust, I have heavy teaching, admin, service and research loads. I have prioritized my efforts on the more recent MRIcroGL. You may want to try that out.
https://www.nitrc.org/plugins/mwiki/index.php/mricrogl:MainPage#Drawing_Regions_of_Interest
Feb 14, 2022 02:02 PM | Chris Rorden
RE: Error while opening MRIcron drawn lesion files in Tracvis as an ROI
Sorry I did not see this, but it looks like the spatial dimensions
are different (182x218x182 vs 181x217x181). More problematically,
the tracvis image does not include any spatial orientation
information (e.g. the SForm). I suspect this is a bug with
TrackVis, and you want to contact that team.
You may want to reslice the drawing to match your target. This is usually a simple script like this one (I would suggest nearest neighbor interpolation for binary lesion maps):
https://github.com/rordenlab/spmScripts/blob/master/nii_reslice_target.m
However, these scripts will be confounded by the fact that the TrackVis spatial transform has not been set. You will want to sort that out first.
You may want to reslice the drawing to match your target. This is usually a simple script like this one (I would suggest nearest neighbor interpolation for binary lesion maps):
https://github.com/rordenlab/spmScripts/blob/master/nii_reslice_target.m
However, these scripts will be confounded by the fact that the TrackVis spatial transform has not been set. You will want to sort that out first.
Feb 14, 2022 05:02 PM | Roger Newman-Norlund
RE: Error while opening MRIcron drawn lesion files in Tracvis as an ROI
Hello Ciu,
I suggest you use MRIcroGL for this operation, it is the new incarnation of the older mricron.
You can download it from github: https://github.com/rordenlab/MRIcroGL/releases
I can help you draw the ROI if you have difficulty using this program, just let me know,
Best,
Roger
I suggest you use MRIcroGL for this operation, it is the new incarnation of the older mricron.
You can download it from github: https://github.com/rordenlab/MRIcroGL/releases
I can help you draw the ROI if you have difficulty using this program, just let me know,
Best,
Roger
Feb 14, 2022 05:02 PM | PRABHAKAR AT - Christian Medical College and Hospital
RE: Error while opening MRIcron drawn lesion files in Tracvis as an ROI
Hi ,
I had the same problem. You need to reslice it to the original MNI template. If you want i can share the Python script that worked for me.
Kind regards.
I had the same problem. You need to reslice it to the original MNI template. If you want i can share the Python script that worked for me.
Kind regards.