[Camino-users] probabilistic tractography

Mojdeh Zamyadi mojdehzm at gmail.com
Thu May 2 08:51:03 PDT 2013


Thanks for the reply. I downloaded the camino_r1205.tar archive (from: 
http://web4.cs.ucl.ac.uk/research/medic/camino/pmwiki/pmwiki.php?n=Main.Clickthrough) 
and re-installed camino again (after deleting the older version), but 
now that I look at the /camino/bin/track file it shows the last modified 
date as 20 Aug 2012!! Could you please let me know where I can get the 
latest version then?!

Thanks
-M

On 05/02/2013 11:19 AM, Philip A Cook wrote:
> Here's the code that deals with this case:
>
>          // If we still have a small error, return most likely vector
>   	if (1.0 - r<  1E-5) {
>
>              logger.warning("Sampling failed, returning maximum likelihood vector for this iteration in voxel " + i + " " + j + " " + k);
>
> 	    // inefficiently search for ML vector but that's OK because this happens
> 	    // less than once in 10^5 samples
> 	    double ml = 0.0;
> 	    int mlInd = 0;
> 	
> 	    for (int n = 0; n<  numVectors; n++) {
> 		if (likelihood[i][j][k][n]>  ml) {
> 		    ml = likelihood[i][j][k][n];
> 		    mlInd = n;
> 		}
> 	    }
> 	
> 	    lastRandomizedIndex = mlInd;
>   	    return new Vector3D[] {vectors[mlInd]};
>   	}
>
> 	String cdfString = "";
>
> 	for (int n = 0; n<  numVectors; n++) {
> 	    cdfString += n + "\t" + cdf[n] + "\n";
> 	}
>
> 	System.err.println("CDF: " + cdfString);
>
> 	throw new LoggedException("target value (" + r + ") is greater than CDF of all vectors in " +
> 				  "voxel " + i + " " + j + " " + k);
>
>
> I don't get how you can have  r == 0.9999982 and yet still see this error, because 1 - r == 1.8E-6, within the range at which we ought to warn and continue. Are you sure you are running the latest version, and you don't have any compiled code hanging around from a previous version?
>
> A more immediate possibility to avoid this problem might be to use the model bayesdirac_dt, which will use a restricted tensor model (see the Friman paper for details) rather than the ball and stick model. It might be more stable in gray matter.
>
>
> On May 2, 2013, at 9:54 AM, Mojdeh Zamyadi wrote:
>
>> Hi there,
>>
>> I ran the
>>
>> track -inputfile DTI_ec_VoxelOrder.Bfloat -inputmodel bayesdirac -schemefile bvec_rot.scheme -iterations 50 -seedfile aal_affine.nii.gz -brainmask B0_brain_mask.nii.gz>  bayesianTracts.Bfloat
>>
>> command with new version (1205) and I still get the following error:
>>
>> ...
>> 1920    0.9994765
>> 1921    0.9999968
>>
>> Apr 30, 2013 11:03:52 PM misc.LoggedException logException
>> SEVERE: Exception in thread "main" class misc.LoggedException: target value (0.9999982) is greater than CDF of all vectors in voxel 152 167 25
>>      at tractography.BayesDiracRandomizer.getRandomizedPDs(BayesDiracRandomizer.java:223)
>>      at tractography.BayesDiracRandomizer.getRandomizedPDs(BayesDiracRandomizer.java:240)
>>      at tractography.BayesDiracTractographyImage.setVectors(BayesDiracTractographyImage.java:89)
>>      at tractography.ProbabilisticTractographyImage.getPDs(ProbabilisticTractographyImage.java:72)
>>      at tractography.NearestNeighbourInterpolator.getTrackingDirection(NearestNeighbourInterpolator.java:36)
>>      at tractography.EulerFibreTracker.getNextStep(EulerFibreTracker.java:57)
>>      at tractography.FibreTracker.trackFromSeed(FibreTracker.java:353)
>>      at tractography.FibreTracker.trackFromSeed(FibreTracker.java:230)
>>      at apps.StreamlineTractography.execute(StreamlineTractography.java:946)
>>      at apps.EntryPoint.main(EntryPoint.java:284)
>>
>>
>>
>> any idea what's wrong? I really need to get this work as soon as I can so I really appreciate your help.
>>
>> Thanks,
>> -Mojdeh
>>
>>
>> On 04/30/2013 12:33 PM, Mojdeh Zamyadi wrote:
>>> I also tried, masking my DTI data before performing the fitting and I still get the "optimizers.MarquardtMinimiserException: Infinite objective function in mrqcof." exception when running the ballstickfit command. Do you know what might be causing this?
>>>
>>> Thanks,
>>> -Mojdeh
>>>
>>> -------- Original Message --------
>>> Subject:	Re: [Camino-users] probabilistic tractography
>>> Date:	Mon, 29 Apr 2013 13:02:19 -0400
>>> From:	Mojdeh Zamyadi<mojdehzm at gmail.com>
>>> To:	Philip A Cook<cookpa at mail.med.upenn.edu>
>>> CC:	camino-users at www.nitrc.org<camino-users at www.nitrc.org>
>>>
>>> I think I'll wait till tomorrow then.
>>>
>>> I ran the ball and stick model as you advised using the following command:
>>>
>>> ballstickfit DTI_ec_VoxelOrder.Bfloat bvec_rot.scheme -bgmask
>>> B0_brain.nii.gz>  BallStick.Bdouble
>>>
>>> and I get lots of following exception:
>>> optimizers.MarquardtMinimiserException: Infinite objective function in
>>> mrqcof.
>>>
>>> is this normal? I'm not sure why this is happening since I've been using
>>> a background/brain mask (of the B0 image) both for the ballstickfit
>>> command and the track command:
>>>
>>> track -inputfile DTI_ec_VoxelOrder.Bfloat -inputmodel bayesdirac
>>> -schemefile bvec_rot.scheme -iterations 50 -seedfile aal_affine.nii.gz
>>> -brainmask B0_brain_mask.nii.gz>  bayesianTracts.Bfloat
>>>
>>> -Mojdeh
>>>
>>> On 04/29/2013 11:21 AM, Philip A Cook wrote:
>>>> Yeah, you'll need to update Camino from source over SVN, or wait until tomorrow and download the nightly archive again.
>>>>
>>>> An optimization error in the MarquardtMinimiser is probably caused by bad data. One way to reduce these is with a brain mask, but if you get too many it is probably a sign of a more serious problem.
>>>>
>>>> One way to investigate this is to fit the ball and stick model with modelfit and check the exit codes.
>>>>
>>>> On Apr 29, 2013, at 11:12 AM, Mojdeh Zamyadi wrote:
>>>>
>>>>> Thanks so much for the reply. So should I re-install Camino?
>>>>>
>>>>> This is a warning I get quite frequently :
>>>>> "Processing seed 13093 of 14773optimizers.MarquardtMinimiserException: Infinite objective function in mrqcof.
>>>>> optimizers.MarquardtMinimiserException: Infinite objective function in mrqcof."
>>>>>
>>>>> what does this exactly mean? is it fine to get this type of warning?
>>>>>
>>>>> -Mojdeh
>>>>>
>>>>>> On 04/29/2013 10:54 AM, Philip A Cook wrote:
>>>>>>> No worries, it is a legit bug. It happened because the likelihood of all directions in the voxel did not sum precisely to 1.
>>>>>>>
>>>>>>> I have increased the epsilon in r1205 so hopefully this problem should go away. You might see a warning about sampling failure, but this should happen very infrequently. If it does, the program should just use the maximum likelihood vector and carry on, rather than crashing.
>>>>>>>
>>>>>>>
>>>>>>> On Apr 26, 2013, at 12:59 PM, Mojdeh Zamyadi wrote:
>>>>>>>
>>>>>>>> Sorry for bombarding you with questions! I tried the same command on another subject and I get the same error (at the same spot)! So, this means it's probably not the subject but something with either the AAL atlas mask or the command options. Once again I greatly appreciate your input since I have no idea how to proceed from here! :(
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> -Mojdeh
>>>>>>>>
>>>>>>>> On 04/25/2013 10:12 AM, Mojdeh Zamyadi wrote:
>>>>>>>>> tried it with the brain mask:
>>>>>>>>>
>>>>>>>>> track -inputfile DTI_ec_VoxelOrder.Bfloat -inputmodel bayesdirac
>>>>>>>>> -schemefile bvec_rot.scheme -iterations 50 -seedfile aal_affine.nii.gz
>>>>>>>>> -brainmask B0_brain_mask.nii.gz>     bayesianTracts.Bfloatand
>>>>>>>>>
>>>>>>>>> and still get the following:
>>>>>>>>>
>>>>>>>>> ...
>>>>>>>>> 1917    0.9979156
>>>>>>>>> 1918    0.9984359
>>>>>>>>> 1919    0.9989562
>>>>>>>>> 1920    0.9994765
>>>>>>>>> 1921    0.9999968
>>>>>>>>>
>>>>>>>>> Apr 23, 2013 6:50:34 PM misc.LoggedException logException
>>>>>>>>> SEVERE: Exception in thread "main" class misc.LoggedException: target
>>>>>>>>> value (0.9999972) is greater than CDF of all vectors in voxel 164 194 38
>>>>>>>>>      at
>>>>>>>>> tractography.BayesDiracRandomizer.getRandomizedPDs(BayesDiracRandomizer.java:223)
>>>>>>>>>      at
>>>>>>>>> tractography.BayesDiracRandomizer.getRandomizedPDs(BayesDiracRandomizer.java:240)
>>>>>>>>>      at
>>>>>>>>> tractography.BayesDiracTractographyImage.setVectors(BayesDiracTractographyImage.java:89)
>>>>>>>>>      at
>>>>>>>>> tractography.ProbabilisticTractographyImage.getPDs(ProbabilisticTractographyImage.java:72)
>>>>>>>>>      at
>>>>>>>>> tractography.NearestNeighbourInterpolator.getTrackingDirection(NearestNeighbourInterpolator.java:36)
>>>>>>>>>      at
>>>>>>>>> tractography.EulerFibreTracker.getNextStep(EulerFibreTracker.java:57)
>>>>>>>>>      at tractography.FibreTracker.trackFromSeed(FibreTracker.java:353)
>>>>>>>>>      at tractography.FibreTracker.trackFromSeed(FibreTracker.java:230)
>>>>>>>>>      at apps.StreamlineTractography.execute(StreamlineTractography.java:946)
>>>>>>>>>      at apps.EntryPoint.main(EntryPoint.java:284)
>>>>>>>>>
>>>>>>>>> Exception in thread "main" misc.LoggedException: target value
>>>>>>>>> (0.9999972) is greater than CDF of all vectors in voxel 164 194 38
>>>>>>>>>      at
>>>>>>>>> tractography.BayesDiracRandomizer.getRandomizedPDs(BayesDiracRandomizer.java:223)
>>>>>>>>>      at
>>>>>>>>> tractography.BayesDiracRandomizer.getRandomizedPDs(BayesDiracRandomizer.java:240)
>>>>>>>>>      at
>>>>>>>>> tractography.BayesDiracTractographyImage.setVectors(BayesDiracTractographyImage.java:89)
>>>>>>>>>      at
>>>>>>>>> tractography.ProbabilisticTractographyImage.getPDs(ProbabilisticTractographyImage.java:72)
>>>>>>>>>      at
>>>>>>>>> tractography.NearestNeighbourInterpolator.getTrackingDirection(NearestNeighbourInterpolator.java:36)
>>>>>>>>>      at
>>>>>>>>> tractography.EulerFibreTracker.getNextStep(EulerFibreTracker.java:57)
>>>>>>>>>      at tractography.FibreTracker.trackFromSeed(FibreTracker.java:353)
>>>>>>>>>      at tractography.FibreTracker.trackFromSeed(FibreTracker.java:230)
>>>>>>>>>      at apps.StreamlineTractography.execute(StreamlineTractography.java:946)
>>>>>>>>>      at apps.EntryPoint.main(EntryPoint.java:284)
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> any idea what might be going wrong? it's actually stock in Processing
>>>>>>>>> ROI 1 of 116!
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> -M
>>>>>>>>>
>>>>>>>>> On 04/23/2013 04:01 PM, Philip Cook wrote:
>>>>>>>>>> Try adding a brain / background binary mask with -brainmask
>>>>>>>>>>
>>>>>>>>>> Sent from my iPhone
>>>>>>>>>>
>>>>>>>>>> On Apr 23, 2013, at 12:49 PM, Mojdeh Zamyadi
>>> <mojdehzm at gmail.com>
>>>       wrote:
>>>>>>>>>>> so I tried the following command (where, "aal_affine.nii.gz" is the AAL template with 116 regions, non-linearly registered to the DTI space)
>>>>>>>>>>>
>>>>>>>>>>> track -inputfile DTI_ec_VoxelOrder.Bfloat -inputmodel bayesdirac -schemefile bvec_rot.scheme -iterations 50 -seedfile aal_affine.nii.gz>      bayesianTracts.Bfloat
>>>>>>>>>>>
>>>>>>>>>>> and I got this error at the end:
>>>>>>>>>>>
>>>>>>>>>>> 1920    0.9994765
>>>>>>>>>>> 1921    0.9999968
>>>>>>>>>>>
>>>>>>>>>>> Apr 23, 2013 8:48:58 AM misc.LoggedException logException
>>>>>>>>>>> SEVERE: Exception in thread "main" class misc.LoggedException: target value (0.9999989) is greater than CDF of all vectors in voxel 143 160 61
>>>>>>>>>>>       at tractography.BayesDiracRandomizer.getRandomizedPDs(BayesDiracRandomizer.java:223)
>>>>>>>>>>>       at tractography.BayesDiracRandomizer.getRandomizedPDs(BayesDiracRandomizer.java:240)
>>>>>>>>>>>       at tractography.BayesDiracTractographyImage.setVectors(BayesDiracTractographyImage.java:89)
>>>>>>>>>>>       at tractography.ProbabilisticTractographyImage.getPDs(ProbabilisticTractographyImage.java:72)
>>>>>>>>>>>       at tractography.NearestNeighbourInterpolator.getTrackingDirection(NearestNeighbourInterpolator.java:36)
>>>>>>>>>>>       at tractography.EulerFibreTracker.getNextStep(EulerFibreTracker.java:57)
>>>>>>>>>>>       at tractography.FibreTracker.trackFromSeed(FibreTracker.java:353)
>>>>>>>>>>>       at tractography.FibreTracker.trackFromSeed(FibreTracker.java:230)
>>>>>>>>>>>       at apps.StreamlineTractography.execute(StreamlineTractography.java:946)
>>>>>>>>>>>       at apps.EntryPoint.main(EntryPoint.java:284)
>>>>>>>>>>>
>>>>>>>>>>> Exception in thread "main" misc.LoggedException: target value (0.9999989) is greater than CDF of all vectors in voxel 143 160 61
>>>>>>>>>>>       at tractography.BayesDiracRandomizer.getRandomizedPDs(BayesDiracRandomizer.java:223)
>>>>>>>>>>>       at tractography.BayesDiracRandomizer.getRandomizedPDs(BayesDiracRandomizer.java:240)
>>>>>>>>>>>       at tractography.BayesDiracTractographyImage.setVectors(BayesDiracTractographyImage.java:89)
>>>>>>>>>>>       at tractography.ProbabilisticTractographyImage.getPDs(ProbabilisticTractographyImage.java:72)
>>>>>>>>>>>       at tractography.NearestNeighbourInterpolator.getTrackingDirection(NearestNeighbourInterpolator.java:36)
>>>>>>>>>>>       at tractography.EulerFibreTracker.getNextStep(EulerFibreTracker.java:57)
>>>>>>>>>>>       at tractography.FibreTracker.trackFromSeed(FibreTracker.java:353)
>>>>>>>>>>>       at tractography.FibreTracker.trackFromSeed(FibreTracker.java:230)
>>>>>>>>>>>       at apps.StreamlineTractography.execute(StreamlineTractography.java:946)
>>>>>>>>>>>       at apps.EntryPoint.main(EntryPoint.java:284)
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> Could you please help me with why I'm getting this?
>>>>>>>>>>>
>>>>>>>>>>> Thanks,
>>>>>>>>>>> -M
>>>>>>>>>>>
>>>>>>>>>>> On 04/23/2013 12:19 PM, Mojdeh Zamyadi wrote:
>>>>>>>>>>>> Thanks for the reply! Based on what I read, it means that I can use the whole atlas, right? no need to produce separate seed regions, am I right?
>>>>>>>>>>>>
>>>>>>>>>>>> On 04/23/2013 11:13 AM, Philip Cook wrote:
>>>>>>>>>>>>> I'm at ismrm right now so apologies for the brief reply. Please see the man page for conmat
>>>>>>>>>>>>>
>>>>>>>>>>>>> Sent from my iPhone
>>>>>>>>>>>>>
>>>>>>>>>>>>> On Apr 23, 2013, at 9:03 AM, Mojdeh Zamyadi
>>> <mojdehzm at gmail.com>
>>>        wrote:
>>>>>>>>>>>>>> Hi all,
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> I want to perform probabilistic tractography using Camino to construct connectivity matrices. To do this I'm using the AAL template with more than 100 cortical and subcortical regions. I've transformed the AAL VOIs into the DTI space of each subject using linear and nonlinear registration. My question now is, should I use "track" command with "-inputmodel bayesdirac" option and use the whole transformed AAL atlas as seedfile (eg. -seedfile Control/aal_ROIs/aal_tformed.nii.gz)? Or should I create separate mask/seed images for each region and perform the tractography for each seed? Also, how can I get the the tracks between two seed regions? Your help would be greatly appreciated!
>>>>>>>>>>>>>>
>>>>>>>>>>>>>> Thanks as always,
>>>>>>>>>>>>>> -Mojdeh
>>>>>>>>>>>>>> _______________________________________________
>>>>>>>>>>>>>> Camino-users mailing list
>>>>>>>>>>>>>>
>>> Camino-users at www.nitrc.org
>>>
>>> http://www.nitrc.org/mailman/listinfo/camino-users
>>>
>>>>>>>>>>> _______________________________________________
>>>>>>>>>>> Camino-users mailing list
>>>>>>>>>>>
>>> Camino-users at www.nitrc.org
>>>
>>> http://www.nitrc.org/mailman/listinfo/camino-users
>>>
>>>>> _______________________________________________
>>>>> 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