[Mrtrix-discussion] filter_tracks

Robert Smith robert.smith at florey.edu.au
Mon Jun 19 20:52:11 PDT 2017


Hi Ilaria,

I just tested the filter_tracks command, and it appears to be behaving as
expected:

> filter_tracks is doing an OR operation rather than AND, when I use two
combined ROIs.

If by "combined ROIs" you mean that you have taken two separate ROI images,
each with a single "blob", and then taken e.g. the sum of those two images
and written it to a new image, and provided that final image in
filter_tracks using the -include option: Then yes, MRtrix will effectively
perform an OR operation. Once those images are combined, MRtrix doesn't
care whether or not there are multiple individual "blobs" in the image;
it's simply testing each streamline to see if the image is non-zero at any
point along the streamline. Similarly, if you do the same experiment but in
conjunction with the -invert option, then only streamlines that do not
intersect the mask image at any point along their length will be written to
the output file.

> I don’t get any filtering when I use   -include roi1    -include roi2

By "no filtering", do you mean that all input streamlines are being written
to the output file? This behaved exactly as expected for me:
filter_tracks in.tck -include ROI0.mif -include ROI1.mif out.tck  selects
only those streamlines that go through *both* ROIs.
filter_tracks in.tck -include ROI0.mif -include ROI1.mif -invert out.tck
omits those streamlines that traverse both ROIs, but writes all other
streamlines to file (including those that intersect one ROI but not the
other).

I would suggest checking your data very closely to make sure you are in
fact providing the correct images / tracks to the command. If you are
struggling to extract a complex bundle, I would suggest instead manually
drawing very simple ROIs in the middle of the white matter, and
experimenting with the filter_tracks command using those ROIs, in order to
ensure that everything is behaving as it should.

Cheers
Rob


--

*Robert Smith, Ph.D*
Senior Research Officer, Imaging Division

The Florey Institute of Neuroscience and Mental Health
Melbourne Brain Centre - Austin Campus
245 Burgundy Street
Heidelberg Vic 3084
Ph: +61 3 9035 7128
Fax: +61 3 9035 7301
www.florey.edu.au

*MRtrix3*: Advanced tools for the analysis of diffusion MRI data
Website <http://www.mrtrix.org/> - Blog <http://www.mrtrix.org/blog/> -
Repository <https://github.com/MRtrix3/mrtrix3> - Community forum
<http://community.mrtrix.org/>

On Wed, Jun 14, 2017 at 6:50 AM, Ilaria Sani <isani01 at mail.rockefeller.edu>
wrote:

> Sorry Rob,  I made a mistake…
>
> My problem is that:
>
>
>
> filter_tracks is doing an OR operation rather than AND, when I use two
> combined ROIs.
>
>
>
> +
>
>
>
> I don’t get any filtering when I use   -include roi1    -include roi2
>
>
>
> Is that working for you?
>
> Am I doing something wrong/different?
>
>
>
>
>
>
>
> Thanks,
>
> Ilaria
>
>
>
> *From:* mrtrix-discussion-bounces at www.nitrc.org [mailto:mrtrix-discussion-
> bounces at www.nitrc.org] *On Behalf Of *Ilaria Sani
> *Sent:* Tuesday, June 13, 2017 3:21 PM
> *To:* Robert Smith <robert.smith at florey.edu.au>
>
> *Cc:* mrtrix-discussion at www.nitrc.org
> *Subject:* Re: [Mrtrix-discussion] filter_tracks
>
>
>
> Hi Rob,
>
>
>
> I’m using the syntax suggested in filter_tracks documentation:
>
> filter_tracks [ options ] input output
>
>
>
> that is:
>
> filter_tracks    -invert     -include    *my-combined-rois*
> *my-input-connectome*    *output.tck*
>
> This is working, but it’s doing an AND operation rather than OR.
>
>
>
> I also tried to use –include twice, once for each roi.
>
> I don’t get any error, but no filtering is happening.
>
> For example, if my input connectome has 500k streamlines, the filtered
> output connectome will have 500k streamlines too.
>
> Here is my syntax:
>
> filter_tracks    *my-intput-connectome*    -include roi1    -include
> roi2    -invert *output.tck*
>
> or
>
> filter_tracks    -include roi1    -include roi2    -invert
> *my-intput-connectome*    *output.tck*
>
>
>
> Is that working for you?
>
> Am I doing something wrong/different?
>
>
>
> Thanks,
>
> Ilaria
>
>
>
>
>
> *From:* Robert Smith [mailto:robert.smith at florey.edu.au
> <robert.smith at florey.edu.au>]
> *Sent:* Monday, June 12, 2017 9:05 PM
> *To:* Ilaria Sani <isani01 at rockefeller.edu>
> *Cc:* mrtrix-discussion at www.nitrc.org
> *Subject:* Re: [Mrtrix-discussion] filter_tracks
>
>
>
> Hi Ilaria,
>
>
>
> If you combine the two ROIs into a single image, then filter_tracks will
> treat that singular image as a single ROI, and
> hence operate on any track that touches any highlighted voxel in that
> image.
> This is why any track touching *either* of the two ROIs is being removed.
>
>
>
> In order to perform your desired operation (remove all tracks that touch
> both ROIs), you want to use the following:
>
>
>
> filter_tracks in.tck -include ROI1.mif -include ROI2.mif -invert out.tck
>
>
>
> By providing the two ROIs separately to filter_tracks using separate
> -include options, you are specifying that you are
>
> interested only in tracks that touch both ROIs. The -invert option then
> specifies that those streamlines elected by the
>
> ROIs are to be *excluded* from the output, rather than being the only
> streamlines included in the output.
>
>
>
> Cheers
>
> Rob
>
>
>
> --
>
> *Robert Smith, Ph.D*
> Senior Research Officer, Imaging Division
>
> The Florey Institute of Neuroscience and Mental Health
> Melbourne Brain Centre - Austin Campus
> 245 Burgundy Street
> Heidelberg Vic 3084
> Ph: +61 3 9035 7128 <+61%203%209035%207128>
> Fax: +61 3 9035 7301 <+61%203%209035%207301>
> www.florey.edu.au
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.florey.edu.au_&d=DwMFaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=YP6hL_RiH1GzLni5-fQIc9iVR40St75EyTMGejOj-k4&m=Vu67mF4YNrX2iO4rwrovBrbhXAwd-oou9Cr88dECwo0&s=azRcMvKDTbK_t1OtNcmpCVjII20tAA99t5Sr3yu4Jq4&e=>
>
>
>
> *MRtrix3*: Advanced tools for the analysis of diffusion MRI data
>
> Website
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mrtrix.org_&d=DwMFaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=YP6hL_RiH1GzLni5-fQIc9iVR40St75EyTMGejOj-k4&m=Vu67mF4YNrX2iO4rwrovBrbhXAwd-oou9Cr88dECwo0&s=hPkZWFiRlkAopMx3WsLeANC99YUEkTBc4tHENjhzZJg&e=>
> - Blog
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.mrtrix.org_blog_&d=DwMFaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=YP6hL_RiH1GzLni5-fQIc9iVR40St75EyTMGejOj-k4&m=Vu67mF4YNrX2iO4rwrovBrbhXAwd-oou9Cr88dECwo0&s=gEf4eHJ21qIW_lpQImNlPP8EdjUcCSia7-ecw-Hd0CY&e=>
> - Repository
> <https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_MRtrix3_mrtrix3&d=DwMFaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=YP6hL_RiH1GzLni5-fQIc9iVR40St75EyTMGejOj-k4&m=Vu67mF4YNrX2iO4rwrovBrbhXAwd-oou9Cr88dECwo0&s=48EQDWs-nHYYCnkgaJQ3hpcXHR5WhpOKgpVK50mXvYo&e=>
> - Community forum
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__community.mrtrix.org_&d=DwMFaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=YP6hL_RiH1GzLni5-fQIc9iVR40St75EyTMGejOj-k4&m=Vu67mF4YNrX2iO4rwrovBrbhXAwd-oou9Cr88dECwo0&s=CUiQWQ8ND7m-y9_G9tTqj19USd5e-7VReXeZUdnCvEM&e=>
>
>
>
> On Mon, Jun 12, 2017 at 4:18 AM, Ilaria Sani <isani01 at mail.rockefeller.edu>
> wrote:
>
> Dear All,
>
> I'm using Mrtrix 0.2
>
> I would like to remove some specific tracks from my connectome.
> Specifically all the tracks between two ROIs.
>
> The closest thing I found is filter_tracks.
> The ROI I’m using is the combination of the two ROIs.
> However filter_tracks removes all the streamlines touching one OR the
> other ROI.
>
> Is there a way to select only the streamlines touching both?
> Alternatively, is there any other tool that removes tracks between two
> ROIs from the connectome?
>
> Thanks!!
>
> Ilaria
> _______________________________________________
> Mrtrix-discussion mailing list
> Mrtrix-discussion at www.nitrc.org
> http://www.nitrc.org/mailman/listinfo/mrtrix-discussion
> <https://urldefense.proofpoint.com/v2/url?u=http-3A__www.nitrc.org_mailman_listinfo_mrtrix-2Ddiscussion&d=DwMFaQ&c=JeTkUgVztGMmhKYjxsy2rfoWYibK1YmxXez1G3oNStg&r=YP6hL_RiH1GzLni5-fQIc9iVR40St75EyTMGejOj-k4&m=Vu67mF4YNrX2iO4rwrovBrbhXAwd-oou9Cr88dECwo0&s=UD94m_2Uuz6CbYnaYaw3aR0t6FUHjL-FbrtKDdj4pOg&e=>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.nitrc.org/pipermail/mrtrix-discussion/attachments/20170620/3664df4d/attachment-0001.html>


More information about the Mrtrix-discussion mailing list