LTS5 / cmp_nipype

This repository is meant to host a beta version for the future release of the ConnectomeMapper.
Other
13 stars 5 forks source link

Streamtrack loop #25

Closed MarcRamos closed 8 years ago

MarcRamos commented 10 years ago

Hello, I was computing some DTI data and it got stuck in the tracking (with mrtrix). It is repeating the process forever and ever. Running: streamtrack -number 1500000 -mask /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/diffusion_stage/mask_resample/wm_mask_resampled.nii -maxnum 145155115 -length 500.0 -curvature 1.0 -minlength 20.0 -seed /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/diffusion_stage/tracking/mrtrix_seeds/ROIv_HR_th_scale33_flirt_out_dil_seed_25.nii.gz -step 0.2 SD_PROB /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/diffusion_stage/reconstruction/mrtrix_CSD/diffusion_resampled_CSD.mif diffusion_resampled_CSD_tracked.tck 140213-10:05:11,348 workflow ERROR: ['Node _mrtrix_probabilistic_tracking20 failed to run on host cloudn.'] 140213-10:05:11,349 workflow INFO: Saving crash info to /home/marc/cmp_nipype/crash-20140213-100511-marc-_mrtrix_probabilistic_tracking20.npz 140213-10:05:11,377 workflow INFO: Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/nipype/pipeline/plugins/multiproc.py", line 15, in run_node result['result'] = node.run(updatehash=updatehash) File "/usr/local/lib/python2.7/dist-packages/nipype/pipeline/engine.py", line 1128, in run self._run_interface() File "/usr/local/lib/python2.7/dist-packages/nipype/pipeline/engine.py", line 1226, in _run_interface self._result = self._run_command(execute) File "/usr/local/lib/python2.7/dist-packages/nipype/pipeline/engine.py", line 1350, in _run_command result = self._interface.run() File "/usr/local/lib/python2.7/dist-packages/nipype/interfaces/base.py", line 823, in run runtime = self._run_interface(runtime) File "/usr/local/lib/python2.7/dist-packages/nipype/interfaces/base.py", line 1104, in _run_interface self.raise_exception(runtime) File "/usr/local/lib/python2.7/dist-packages/nipype/interfaces/base.py", line 1060, in raise_exception raise RuntimeError(message) RuntimeError: Command: streamtrack -number 1500000 -mask /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/diffusion_stage/mask_resample/wm_mask_resampled.nii -maxnum 145155115 -length 500.0 -curvature 1.0 -minlength 20.0 -seed /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/diffusion_stage/tracking/mrtrix_seeds/ROIv_HR_th_scale33_flirt_out_dil_seed_21.nii.gz -step 0.2 SD_PROB /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/diffusion_stage/reconstruction/mrtrix_CSD/diffusion_resampled_CSD.mif diffusion_resampled_CSD_tracked.tck Standard output: Standard error: 7828702 generated, 491468 selected [ 32%]Killed Return code: 137 Interface StreamlineTrack failed to run.

Yes I know I put and absurd number of max fibers, but I didn't care much, what I wanted was a 1.5e6 number of fibers. Is that causing the problem? Even if I change the number of max tracks it keeps computing the tracks with that parameter... Any help would be appreciated. Thanks in advance, Marc.

MarcRamos commented 10 years ago

Dears, Now I tried to start again the connectome and it is doing the segmentation stage again, when it had it done before. Is possible that is not detecting it as finished stage? When I clicked on the Map connectome! botton it says that segmentation was running... and before it had finished. Please note that this is the largest stage and takes a lot of time, if it is not correctly detected is a waste of time. Thanks!! Marc

davidrs06 commented 10 years ago

Dear Marc,

Regarding your first comment, it seems that you are performing probabilistic tractography using the Lausanne2008 parcellation. Is this the case ? Because in probabilistic tractography, the desired number of tracks is generated using each ROI in the parcellation as seeding point, separately. The CMP calls the streamtrack command for each ROI found in the Lausanne2008 parcellation. That means it will execute it 83 times for the first scale, 129 times for the 2nd scale, etc... up to 1015 times for the 5th scale. And it will try to generate 1.5 million fibers each time. If you want it to perform faster, try a lower number of tracks

If you want 1.5 million fibers in the final output, better use deterministic tractography. This will generate 1.5 million fibers in the white matter only once, without looping over the ROIs.

As for the computation by Freesurfer, did you click on the "New connectome data" when opening the connectome mapper again ? If that's the case, the tracking of previously computed data is reset. A warning should actually be implemented to pop up in order to avoid loosing data by mistake.

If that's not the case, the problem might be due to the last changes in the CMP versions. You installed the last version yesterday right ? Would you mind letting Freesurfer finish the parcellation again and tell me if you still have this problem ? Once it is finished, save a copy of /home/marc/TOC/TOC_cmp2/FREESURFER and /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/segmentation_stage/reconall somewhere, just in case. Sorry for the mess, but the last version does recognize previously computed Freesurfer data on my computer. It might fail however if the data was computed by a previous version of CMP.

Thanks a lot for keeping us updated !

Let me know how it goes, David Romascano

MarcRamos commented 10 years ago

Hi. Yes sorry, actually I wanted to use deterministic. I put load data and the segmentation stage was detected as not done.

2014-02-13 13:39 GMT+01:00 davidrs06 notifications@github.com:

Dear Marc,

Regarding your first comment, it seems that you are performing probabilistic tractography using the Lausanne2008 parcellation. Is this the case ? Because in probabilistic tractography, the desired number of tracks is generated using each ROI in the parcellation as seeding point, separately. The CMP calls the streamtrack command for each ROI found in the Lausanne2008 parcellation. That means it will execute it 83 times for the first scale, 129 times for the 2nd scale, etc... up to 1015 times for the 5th scale. And it will try to generate 1.5 million fibers each time. If you want it to perform faster, try a lower number of tracks

If you want 1.5 million fibers in the final output, better use deterministic tractography. This will generate 1.5 million fibers in the white matter only once, without looping over the ROIs.

As for the computation by Freesurfer, did you click on the "New connectome data" when opening the connectome mapper again ? If that's the case, the tracking of previously computed data is reset. A warning should actually be implemented to pop up in order to avoid loosing data by mistake.

If that's not the case, the problem might be due to the last changes in the CMP versions. You installed the last version yesterday right ? Would you ming letting Freesurfer finish the parcellation again and tell me if you still have this problem ? Once it is finished, save a copy of /home/marc/TOC/TOC_cmp2/FREESURFER and /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/segmentation/reconall somewhere, just in case. Sorry for the mess, but the last version does recognize previously computed Freesurfer data on my computer. It might fail however if the data was computed by a previous version of CMP.

Thanks a lot for keeping us updated !

Let me know how it goes, David Romascano

Reply to this email directly or view it on GitHubhttps://github.com/LTS5/cmp_nipype/issues/25#issuecomment-34974212 .

davidrs06 commented 10 years ago

Hi again,

Sorry for the segmentation stage running again, I'm not sure of what went wrong there, but it might be because it was computed with a previous version of CMP and because of the changes I made to the CMP in between. Would you mind letting it finish again ? I want to see if you still have the problem when the FS data is computed with the last version...

MarcRamos commented 10 years ago

Ok I tell you when it finishes

2014-02-13 14:04 GMT+01:00 davidrs06 notifications@github.com:

Hi again,

Sorry for the segmentation stage running again, I'm not sure of what went wrong there, but it might be because it was computed with a previous version of CMP and because of the changes I made to the CMP in between. Would you mind letting it finish again ? I want to see if you still have the problem when the FS data is computed with the last version...

Reply to this email directly or view it on GitHubhttps://github.com/LTS5/cmp_nipype/issues/25#issuecomment-34975729 .

MarcRamos commented 10 years ago

Hi David, it finished correctly and the tracks look good!

2014-02-13 14:06 GMT+01:00 Marc Ramos m4rklar@gmail.com:

Ok I tell you when it finishes

2014-02-13 14:04 GMT+01:00 davidrs06 notifications@github.com:

Hi again,

Sorry for the segmentation stage running again, I'm not sure of what went wrong there, but it might be because it was computed with a previous version of CMP and because of the changes I made to the CMP in between. Would you mind letting it finish again ? I want to see if you still have the problem when the FS data is computed with the last version...

Reply to this email directly or view it on GitHubhttps://github.com/LTS5/cmp_nipype/issues/25#issuecomment-34975729 .

davidrs06 commented 10 years ago

Hi again !

Could you save a copy of /FREESURFER and /NIPYPE/diffusion_pipeline/segmentation_stage/reconall somewhere, close and open the Connectome Mapper and run the analysis again ? Just to check if the CMP correctly detects the segmentation as already done.

Does it work ?

MarcRamos commented 10 years ago

Hello,

I have cut these folders somewhere else (so they are not in the subject folder anymore) and run it again: Executing node reconall in dir: /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/segmentation_stage/reconall 140214-10:13:00,763 workflow INFO: Running: recon-all -i /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/segmentation_stage/mgz_convert/T1.mgz -cw256 -all -subjid /home/marc/TOC/TOC_cmp2/FREESURFER -sd /home/marc/TOC/TOC_cmp2

It executes the stage. Is that what you wanted me to do?

2014-02-14 9:58 GMT+01:00 davidrs06 notifications@github.com:

Hi again !

Could you save a copy of /FREESURFER and /NIPYPE/diffusion_pipeline/segmentation_stage/reconall somewhere, close and open the Connectome Mapper and run the analysis again ? Just to check if the CMP correctly detects the segmentation as already done.

Does it work ?

Reply to this email directly or view it on GitHubhttps://github.com/LTS5/cmp_nipype/issues/25#issuecomment-35066655 .

MarcRamos commented 10 years ago

Now I wanted to put a custom atlas, I have the nifti, the region's labels, and the region's position. But the connectome mapper segmentation stage changes automatically to custom also. I require a white matter mask for it? This I don't understand, could you briefly explain, please?

Thanks, Marc.

2014-02-14 10:14 GMT+01:00 Marc Ramos m4rklar@gmail.com:

Hello,

I have cut these folders somewhere else (so they are not in the subject folder anymore) and run it again: Executing node reconall in dir: /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/segmentation_stage/reconall 140214-10:13:00,763 workflow INFO: Running: recon-all -i /home/marc/TOC/TOC_cmp2/NIPYPE/diffusion_pipeline/segmentation_stage/mgz_convert/T1.mgz -cw256 -all -subjid /home/marc/TOC/TOC_cmp2/FREESURFER -sd /home/marc/TOC/TOC_cmp2

It executes the stage. Is that what you wanted me to do?

2014-02-14 9:58 GMT+01:00 davidrs06 notifications@github.com:

Hi again !

Could you save a copy of /FREESURFER and /NIPYPE/diffusion_pipeline/segmentation_stage/reconall somewhere, close and open the Connectome Mapper and run the analysis again ? Just to check if the CMP correctly detects the segmentation as already done.

Does it work ?

Reply to this email directly or view it on GitHubhttps://github.com/LTS5/cmp_nipype/issues/25#issuecomment-35066655 .

davidrs06 commented 10 years ago

You need to specify a white matter mask that is compatible with your custom atlas. I guess you want to use the AAL atlas, as you mentionned on your other post. In this case, you should specify the white matter mask computed by SPM.

davidrs06 commented 10 years ago

Regarding the Freesurfer segmentation, could you copy the FREESURFER and /NIPYPE/diffusion_pipeline/segmentation_stage/reconall back to the subject directory and run the mapping up to the parcellation stage again ? Just to check that the CMP recognizes the segmentation as done now (keep a copy of the FREESURFER and /NIPYPE/diffusion_pipeline/segmentation_stage/reconall directories just in case).

MarcRamos commented 10 years ago

Yes the detection is correct now! Sorry I didnt understand earlier. Is there another way to get the white matter mask? I don't have SPM installed and I am having difficulties installing in Linux64b I downloaded the spm8 and the update and I can't find the run_spm8.sh file!

Thanks Marc.

2014-02-14 14:02 GMT+01:00 davidrs06 notifications@github.com:

Regarding the Freesurfer segmentation, could you copy the FREESURFER and /NIPYPE/diffusion_pipeline/segmentation_stage/reconall back to the subject directory and run the mapping up to the parcellation stage again ? Just to check that the CMP recognizes the segmentation as done now (keep a copy of the FREESURFER and /NIPYPE/diffusion_pipeline/segmentation_stage/reconall directories just in case).

Reply to this email directly or view it on GitHubhttps://github.com/LTS5/cmp_nipype/issues/25#issuecomment-35081251 .

davidrs06 commented 10 years ago

Good news for the segmentation step, thanks !

Regarding the white matter mask, how did you get the AAL atlas for your subject ?

MarcRamos commented 10 years ago

I was given to me, including the nifti file, a labels file and position file... But they didn't provide with the rest of the files, I asked them if can give me them.

2014-02-14 15:04 GMT+01:00 davidrs06 notifications@github.com:

Good news for the segmentation step, thanks !

Regarding the white matter mask, how did you get the AAL atlas for your subject ?

Reply to this email directly or view it on GitHubhttps://github.com/LTS5/cmp_nipype/issues/25#issuecomment-35085727 .

davidrs06 commented 10 years ago

Ok.

The problem is that if you use the white matter computed by another software (as Freesurfer), the white matter mask might not touch the ROIs everywhere. In that case some fibers might not reach the ROIs and will be discarded during the computation of the connectivity matrix.

I'm not familiar with the AAL algorithms, but my guess is that the brain is segmented into white and grey matter by SPM and then the grey matter is labeled using the AAL algorithm. If you manage to get the white matter mask from SPM, try to overlap it with the atlas. You should see something like here http://cmtk.org/mapper/exampleresults.html#parcellation (no holes between white matter and grey matter labels).

MarcRamos commented 10 years ago

Hello, What you are saying is that I get the AAL atlas for each subject, a grey and a white matter volume for each subject? (that actually makes more sense of what I thought, because they sent me one atlas for all the subjects)

Thanks, Marc

pd: I have installed a standalone version of SPM and it scares me a bit, its GUI is a mess, jeje.

2014-02-14 15:24 GMT+01:00 davidrs06 notifications@github.com:

Ok.

The problem is that if you use the white matter computed by another software (as Freesurfer), the white matter mask might not touch the ROIs everywhere. In that case some fibers might not reach the ROIs and will be discarded during the computation of the connectivity matrix.

I'm not familiar with the AAL algorithms, but my guess is that the brain is segmented into white and grey matter by SPM and then the grey matter is labeled using the AAL algorithm. If you manage to get the white matter mask from SPM, try to overlap it with the atlas. You should see something like here http://cmtk.org/mapper/exampleresults.html#parcellation (no holes between white matter and grey matter labels).

Reply to this email directly or view it on GitHubhttps://github.com/LTS5/cmp_nipype/issues/25#issuecomment-35087309 .

davidrs06 commented 10 years ago

Again, I'm not quite familiar with SPM processing and the AAL atlas, so I can't really help you with the GUI... But yes, you need one atlas and one wm mask for each subject. With Freesurfer, the white matter mask and the atlas are complementary (there is not empty space between the two except when there is CSF like in the ventricles, as you can see here http://cmtk.org/mapper/exampleresults.html#parcellation). I've seen that SPM can perform CSF, GM and WM segmentation, you can ask your colleagues if they have the WM segmentation file available. This WM mask and the atlas should overlay as in the example result on our website.

If they gave you one atlas for all subjects, then your subjects might be aligned to a common space. The wm mask of the common image would be enough.

Hope this helps, sorry I can't give you more information on the AAL atlas, try posting something on the cmtk users group, someone else might know more about this.

Cheers, David Romascano