TDI end-points selection

Hi every one,
this is my first post, so wish me luck :smile:
I have a problem with the TDI and I want to ask for your help. I created a TDI that includes streamlines from a certain ROI(in the below example is lh_po). The commands were

First I created the streamlines using

tckedit tracks_10M.tck lh_po.tck -include lh_po.mif -minlength 25

Then I made the TDI using

tckmap lh_po.tck -contrast tdi -template raw_t1.mif lh_po_tdi_ep.nii.gz -ends_only

Now I have an image that shows endpoints within the ROI and outside the ROI representing both sides of termination points.

What I want is to create a TDI showing only the endpoints outside the ROI and remove the ones within the ROI. Is there a way to do that through mrtrix commands?

Thanks

Mudathir

Hi Mudathir, congrats on stepping up to the plate! :stuck_out_tongue:

I think what you’re looking for is a reasonably simple image intensity operation. Essentially you want to take those voxels that are present in the inclusion region, and set the intensity of the endpoint-TDI image to zero in those locations. You could do that with:

mrcalc 1 lh_po.mif -sub lh_po_tdi_ep.nii.gz -mult winning.mif

The β€œ1 lh_po.mif -sub” bit produces an image that is 1 outside of the ROI and 0 within it. Your endpoint-TDI image is then multiplied by this, zeroing out the unwanted intensities inside of the inclusion ROI.

Cheers
Rob