Automation of multiple Fibertrack saves

Viewing 7 reply threads
  • Author
    Posts
    • #4747
      Whiiz
      Participant

      Dear Hivemind,

      I am using Brainsuite to analyze the fibertracks of 107 subjects.
      Is there a way to automate the saving of multiple fibertracks for each subject?

      Example:
      I have 36 ROI´s (e.g. Putamen to Thalamus, etc.) that I wanna save with Brainsuite.
      Is there a way to “give” Brainsuite a list to save all selected ROI´s?

      At the moment it is very time intensive to click through the whole process to save so many ROI´s for so many subjects, if there is any way to make it faster, I´d really appreciate your input!

    • #4749
      David Shattuck
      Keymaster

      Hello –

      I have written some command-line tools that can probably do this. I thought we were distributing them, but I just checked and they aren’t in the public release yet.

      Can you be more specific about what you are trying to do and what steps you are taking? Are you trying to give it pairs of ROIs and save out a .dft file?

      thanks,
      David

    • #4750
      Whiiz
      Participant

      Hi David,
      thanks for the quick reply!

      I am trying to single out selected fiber tracks and save them for further FA and MD calculations with TractConnect, but on a larger scale.
      At the moment I am manually selecting the desired fibertracks using the computed tracks from the connectivity matrix, and then saving the filtered fiber tracks (e.g. L. Insula to L. Amygdala) as a BrainSuite Track File (*dft).
      What I am looking for now is a way to not click through this process manually for each of my predefined fiber tracks.

    • #4751
      David Shattuck
      Keymaster

      If you send an email to support at brainsuite.org, I’ll see what I can do. Let me know what platform (Mac/Win/Linux) you are using.

      thanks,
      David

    • #4796
      Whiiz
      Participant

      Hey,

      I am still waiting for a response.

      Kind regards,

      Adrien

    • #4799
      David Shattuck
      Keymaster

      hi Adrien –

      I’m working on it — still need to do some testing. Will follow up by email soon with a few questions.

      thanks,
      David

    • #4803
      Whiiz
      Participant

      Thanks for the update, really appreciate it!

    • #4824
      David Shattuck
      Keymaster

      Hi Adrien –

      It took a little longer than expected because we have been preparing a major release of BrainSuite (v23a, out now), as well as an updated BrainSuite BIDS App. We were making some improvements to the underlying methods, including some optimizations in how the streamline filtering is performed.

      The new package includes a program call filterdft, which is in the bin directory. You can use it to perform all of the filtering options that are available in the GUI. These are performed (in order, but the order shouldn’t matter):

      * remove streamlines shorter than the length threshold if specified (-l setting)
      * remove streamlines that intersect labels in the exclude list (specified as –exclude # # #)
      * remove streamlines based on spherical ROI filters if specified (uses an xml file)
      * remove streamlines unless they intersect labels in the include list (specified as –include # # #)

      By default, it will use an or operation for the final check, so if you wanted to include all streamlines that intersect the superior frontal gyri, you would run:

      filterdft -i input.dft -o output.dft --include 120 121
      

      You can use the –and flag if you want to have the streamlines go through *all* labels specified, e.g,. if you want to find streamlines that connect the brainstem (800) and cerebellum (900), you would use:

      filterdft -i input.dft -o output.dft --include 800 900 --and
      

      The full set of options is listed below.

      Let me know if that provides the functionality that you need.

      thanks,
      David

      usage: filterdft [settings]
      
      required settings:
      -i                       input file
      -o                       output file
      -l filename                    label volume (must be 16-bit)
      
      optional settings:
      --license                      show the license information
      -g                             debug
      -v                      verbosity [default: 0]
      --length length                length threshold [default: 0]
      --include           labelID1 ...  labelIDN (include these labels)
      --exclude           labelID1 ...  labelIDN (exclude these labels)
      --and                          tracks must pass through all labels in include list
      --dont-merge                   don't merge cortical gm/wm labels
      -s filename                    sphere ROI xml file
      
      • #4894
        Whiiz
        Participant

        Hi David,

        Thank you for your work!
        I used the following command which only worked once i executed it as an administrator:
        C:\Program Files\BrainSuite23a\bin> filterdft -i ‘C:\files\AllTracksVP001.dft’ -o test.dft -l ‘C:\files\T1.svreg.init.label.nii.gz’ –include 131 225 –and

        But the output file was an empty .dft file.

        My question now is if I used a wrong label or input file?

        Kind regards,
        Adrien

      • #4922
        Whiiz
        Participant

        C:\Program Files\BrainSuite23a\bin> filterdft -i “C:\files\AllTracksVP001.dft” -o test.dft -l “C:\files\T1.svreg.init.label.nii.gz” –include 131 225 –and -v 1
        5504428 starting streamlines
        length filter kept 5504428
        exclude filter kept 5504428
        sphere filter kept 5504428
        include filter kept 0
        0 final tracks
        filtering took 0:01.310

      • #4925
        Whiiz
        Participant

        We worked it out, there was a problem with the used label!

        Thank you very much again for this addition, works like a charm now!

        Kind regards,
        Adrien

Viewing 7 reply threads
  • You must be logged in to reply to this topic.