demianw / tract_querier

Implementation of the White Matter Query Language and associated tools for dMRI white matter tract extraction and analysis
Other
26 stars 27 forks source link

Bounding Box problem with tract_querier... #14

Closed lpetit closed 9 years ago

lpetit commented 9 years ago

Dear Demian,

I'm currently use tract_querier with no problem up to now when I ran the following command line : tract_querier -t whole_brain.trk -a JHU_hau_diff.nii.gz -q JHU_queries.qry -o test --interactive

and I get the following message:

Loading files Calculating labels and crossings Traceback (most recent call last): File "/homes_unix/haemi/Python-2.7.8/bin/tract_querier", line 284, in main() File "/homes_unix/haemi/Python-2.7.8/bin/tract_querier", line 183, in main tracts, img, affine_ijk_2_ras, options.length_threshold, options.threshold File "/homes_unix/haemi/Python-2.7.8/lib/python2.7/site-packages/tract_querier/tract_label_indices.py", line 71, in init self.tract_bounding_boxes = compute_tract_bounding_boxes(self.tractography) File "/homes_unix/haemi/Python-2.7.8/lib/python2.7/site-packages/tract_querier/tract_label_indices.py", line 134, in compute_tract_bounding_boxes bounding_boxes[i] = BoundingBox(ras_coords) File "/homes_unix/haemi/Python-2.7.8/lib/python2.7/site-packages/tract_querier/aabb.py", line 23, in new "Bounding box must have 6 components or be a list of points") ValueError: Bounding box must have 6 components or be a list of points

In fact, it works when the trk file has been created with one seed per voxel during the tractography processing (MRtrix, see Girard et al. (2014), NeuroImage 98:266-278)) and it crashes when the trk file has been created with 20 seeds per voxels. From my point of view, the difference at the level of the input trk file for tract-querier is about the number of streamlines and therefore the size of the file (up to 7 Go for the file coming from 20 seeds per voxels). This is the only difference I'm thinking about between a trk file that works and the one that did not work.

I'll greatly appreciate your help for that.

Best regards,

Laurent Petit GIN-UMR5296 CNRS-CEA-Univ. Bordeaux France

demianw commented 9 years ago

Dear Laurent,

This might be due to a problem in the header of te trk file you are using. If you find it possible to send me your files somehow I will be happy to assist

All the best Demian

Demian Wassermann, PhD demian.wassermann@inria.fr Research Scientist Athena Project Team INRIA Sophia Antipolis - Méditerranée 2004 route des lucioles - FR-06902

demianw commented 9 years ago

Sorry I missed the point that the file is 7gb. Does this work with 2 seeds per voxel? The size of the file should not be an issue.

Best regards Demian

lpetit commented 9 years ago

Thanks Demian for your quick answer!

I don't think that the original number of seeds used to create the trk file is the problem. But I'm not sure also... I checked with another file where I think there were 10 seeds per voxels and it works... but I can't reach the person who created it for now to definitively be sure of that. I can run a whole tractography with 2 seeds and get the results in 24h... this is a long process!

Here is a location with the files I used that gave me the error message.

https://www.dropbox.com/sh/t0z47mivddbqcfa/AABllofqYomOOoyXBYVcaLHIa?dl=0 https://www.dropbox.com/sh/t0z47mivddbqcfa/AABllofqYomOOoyXBYVcaLHIa?dl=0

I forgot to tell you that I have no problem to open the trk file in TrackVis for example.

Thanks again for your help, Laurent

Laurent PETIT

GROUPE D'IMAGERIE http://www.gin.cnrs.fr NEUROFONCTIONNELLE http://www.gin.cnrs.fr UMR5296 - CNRS - CEA - UNIV. BORDEAUX

see my publications here http://www.researchgate.net/profile/Laurent_Petit3/publications/?ev=prf_pubs_p1

Université de Bordeaux, PAC Carreire 146, rue Léo Saignat, CS 61292 33076 Bordeaux Cedex

Mobile : +33 (0)671281912 E-mail : lpetit8@gmail.com

2015-01-23 15:44 GMT+01:00 Demian Wassermann notifications@github.com:

Sorry I missed the point that the file is 7gb. Does this work with 2 seeds per voxel? The size of the file should not be an issue.

Best regards Demian

— Reply to this email directly or view it on GitHub https://github.com/demianw/tract_querier/issues/14#issuecomment-71202662 .

demianw commented 9 years ago

OK, digging a little bit more digging. I think I found the problem. I believe is the fact that the tractography algorithm is producing tracts that are just one point long while my tool requires a tract to be a segment of at least 2 points.

You can remove those by using the command tract_math included in the tool: tract_math tract_remove_short_tracts .01

Hope it works! Best Demian

Demian Wassermann, PhD demian.wassermann@inria.fr Research Scientist Athena Project Team INRIA Sophia Antipolis - Méditerranée 2004 route des lucioles - FR-06902

lpetit commented 9 years ago

This is it! It works after removing that single points. Thank you very much!

Have a nice weekend! Laurent

2015-01-23 18:02 GMT+01:00 Demian Wassermann notifications@github.com:

OK, digging a little bit more digging. I think I found the problem. I believe is the fact that the tractography algorithm is producing tracts that are just one point long while my tool requires a tract to be a segment of at least 2 points.

You can remove those by using the command tract_math included in the tool: tract_math tract_remove_short_tracts .01

Hope it works! Best Demian

Demian Wassermann, PhD demian.wassermann@inria.fr Research Scientist Athena Project Team INRIA Sophia Antipolis - Méditerranée 2004 route des lucioles - FR-06902

— Reply to this email directly or view it on GitHub https://github.com/demianw/tract_querier/issues/14#issuecomment-71225915 .

demianw commented 9 years ago

Hi Laurent,

Glad it worked, I also changed the new version such that it provides a more descriptive message in case you run into the same problem again.

All the best Demian Wassermann, PhD demian.wassermann@inria.fr Research Scientist Athena Project Team INRIA Sophia Antipolis - Méditerranée 2004 route des lucioles - FR-06902