[Camino-users] error when splitting tensor components with shredder
Philip A Cook
cookpa at mail.med.upenn.edu
Fri Jan 24 12:14:48 PST 2014
You can convert to NIFTI with dt2nii, for example
dt2nii -inputmodel twotensor
This creates separate volumes dt1 and dt2. I don't know of a NIFTI standard to combine multitensor data into one volume.
Going back is trickier because nii2dt isn't set up to deal with multi-tensor data, though this is certainly something I could add later.
On Jan 24, 2014, at 4:09 AM, Alessandro Calamuneri <alecalamuneri at gmail.com> wrote:
> Hi Philip,
> thanks for your reply! It worked the way you describe; I was indeed wandering whether an easier way to split tensor components was available, even if into tutorials this was the only way mentioned.
> Would this approach work also for multitensors? I mean, if i fit a two tensors model, knowing the storage is organized in that way
>
> exitcode Encodes information about the reconstruction procedure. -1 means the voxel was skipped as background, 0 indicates success. Positive values mean something went wrong in the reconstruction or some data was modified or excluded. See modelfit for details.
> lnA0 Log of the geometric mean of all measurements at b=0 in this voxel.
> numDTs Number of Gaussian components in this voxel, from 0 to N.
> mix_i Mixing fraction for tensor i, between 0 and 1. Sum of mix_i over all components is 1.
> d**_i
>
> would the code
>
> voxel2image -inputfile dt_2_tens.Bdouble -components 17 (=exitcode+lnA0+numDTs+mix_1+6*dt_1+mix_2+6*dt_2) ...
>
> work?
>
> The point is that I would like to warp all the components using flirt and fnirt, and then go back to camino format with my warped data. How would in this case work the multitensor reconstruction? Sorry but I do not know how NIFTI multitensors are stored, than I do not have idea about what the coding should be. Would nii2dt work also in this case?
> Thanks in advance.
>
> Best,
> Alessandro
>
>
>
> 2014/1/23 Philip A Cook <cookpa at mail.med.upenn.edu>
> Perhaps the problem has to do with the ordering of the components. NIFTI tensors should be lower triangular (dxx, dxy, dyy, dxz, dyz, dzz).
>
> A simpler solution would be to use voxel2image:
>
> voxel2image -inputfile dti.Bdouble -header image.nii.gz -components 8 -outputroot dt_component_
>
> where image.nii.gz is an image with the correct header information (such as the raw DWI data).
>
> The above gives you the components. If you want the tensor in NIFTI symmatrix format, you can use dt2nii.
>
>
> On Jan 23, 2014, at 10:28 AM, Alessandro Calamuneri <alecalamuneri at gmail.com> wrote:
>
> > Hi all,
> > I would like to obtain tensor components computed with using modelfit and nldt_pos as algorithm. Everything seems to work properly, as I can also correctly visualize results using e.g. pdview.
> > But when I want to split this file to obtain single components I eot stuck: here is my code
> >
> > for ((i=0;i<8;i=i+1));do
> > #splitting tensor into its components
> > shredder $((i*8)) 8 56 < dti.Bdouble > DT_comp${i}.img
> > #creating proper header
> > analyzeheader -voxeldims 1.75 1.75 2 -datadims 128 128 74 -datatype double > DT_comp${i}.hdr
> > done
> >
> > If I have correclty understood,my output should be
> >
> > DT_comp0.img which contains exitcode
> > DT_comp1.img which contains log of unweighted signal
> > DT_comp2.img which is DT_xx
> > DT_comp3.img which is DT_xy
> > DT_comp4.img which is DT_xz
> > DT_comp5.img which is DT_yy
> > DT_comp6.img which is DT_yz
> > DT_comp7.img which is DT_zz
> >
> > Now, to check if my assumptions are correct I go back to tensor by means of nii2dt function (before doing that I merge volumes using fslmerge)
> >
> > fslmerge -t tensor DT_xx.nii DT_xy.nii DT_xz.nii DT_yy.nii DT_yz.nii DT_zz.nii
> >
> > so
> >
> > nii2dt -inputfile tensor.nii.gz > dt.Bdouble
> >
> > eventually I calculate fa
> >
> > cat dt.Bdouble | fa | voxel2image -outputroot my_fa -header tensor.nii.gz
> >
> > But when I look at the results fa map is totally wrong as the fa values are in the range [.9 1.2], which is impossible of course.
> >
> > I also tried using linear option and addingo lns0 and mask (inverting endianness as described for mask output of bet2 function) as well .In this last case the code was
> >
> > nii2dt -inputfile tensore.nii.gz -bgmask mask.img -lns0 DT_comp1.img > dt.Bdouble
> >
> > but with no amelioration at all.
> >
> > Where am I wrong? Is the position of tensor components wrong?
> > Is the reconstruction back to camino tensor wrong?
> > Is shredder badly used?
> > Is it a problem of mask endianness?
> >
> >
> > Hope you can help me,
> >
> > Best,
> > Alessandro
> > _______________________________________________
> > Camino-users mailing list
> > Camino-users at www.nitrc.org
> > http://www.nitrc.org/mailman/listinfo/camino-users
>
More information about the Camino-users
mailing list