-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New scripts for conversion, comparison and testing #22
Conversation
Overall, looks great! One general comment/question: would it be possible to implement these functionalities as library code and then make the scripts import and execute this library code? I think it will make it useful in other contexts, easier to test, and also might help reduce some boiler-plate. For example, it would be good to have a |
@arokem So just to be sure, you would put 100% of the main inside of a function and make that function receive only the string (filenames) as parameters? And the behavior would stay the same? |
Yeah - that would be good. If you put them all in the same module, you can start consolidating some of the boiler-plate, e.g., defining supported file-types and checking inputs and so on, and use shared test harnesses (eventually) |
…e_format into testing_script
@arokem Is this ok for now? The visualization scripts are not tested because they are just rendering. |
Yeah - I think that we can go ahead and merge this. I have some ideas for subsequent cleanup and tweaks that we can do -- I'll post some issues. But for now, let's merge this and move ahead with this. |
4 new scripts (python) that will help to go back and forth between formats.
tff_verify_header_compatibility.py
For NIFTI, TRK and TRX only, compares header informations (affine, dimensions, voxel sizes and voxel order) and inform the user about their compatibilitytff_simple_compare.py
Subtract two tractography files in RASMM, VOXMM and VOX and inform the user about their similarity (point to point distance). Does not support tractograms with different streamline count or streamline shuffling (very simple comparison)tff_visualize_overlap.py
Load a tractogram, compute density maps (using 2 approach in Dipy) and render the density map and its bounding box (see below). 3 Rendering will be displayed (RASMM, VOXMM, VOX). If there is an incompatibility between the header and the coordinates the density map computation will crash OR the tractogram won't appear in the right position.tff_convert_tractogram.py
Script to convert from one to another file format (.trk, .tck, .vtk, .fib, .dpy, .trx)tff_verify_header_compatibility.py
should help to verify this.tff_simple_compare.py
failFiles and commands to test this PR:
https://drive.google.com/file/d/1vt9GWy--gRU5sYfgfe-qgFQyN2DHYyQQ/view?usp=sharing