GithubHelp home page GithubHelp logo

Comments (3)

smeisler avatar smeisler commented on May 17, 2024 1

Great, thanks! I appreciate your quick responses to all of my questions, can't wait to get this program running on my end!

from connectomemapper3.

sebastientourbier avatar sebastientourbier commented on May 17, 2024

Hi Steven,

I have good news, this Nipype interface is already implemented in CMP3 here:

class FilterTractogramInputSpec(CommandLineInputSpec):
in_tracks = File(exists=True, mandatory=True, argstr='%s',
position=-3, desc='Input track file')
in_fod = File(exists=True, mandatory=True, argstr='%s', position=-2,
desc='Input image containing the spherical harmonics of the fibre orientation distributions')
out_file = File(argstr='%s', position=-1,
desc='Output text file containing the weighting factor for each streamline')
class FilterTractogramOutputSpec(TraitedSpec):
out_weights = File(
exists=True, desc='Output text file containing the weighting factor for each streamline')
class FilterTractogram(MRTrix3Base):
_cmd = 'tcksift2'
input_spec = FilterTractogramInputSpec
output_spec = FilterTractogramOutputSpec
def _list_outputs(self):
outputs = self.output_spec().get()
if not isdefined(self.inputs.out_file):
outputs['out_weights'] = op.abspath('streamlines_weights.txt')
else:
outputs['out_weights'] = op.abspath(self.inputs.out_file)
return outputs
.
I guess the easiest way would be to add this Nipype interface node to MRtrix3 sift2 directly in the tracking subworkflow.
This means this would need the following changes:

  • Updating imports from cmtklib.interfaces.mrtrix3 with FilterTractogram here:

    from cmtklib.interfaces.mrtrix3 import Erode, StreamlineTrack

  • Creating this new workflow node and rearranging the workflow connections here:

    flow.connect([
    (inputnode, mrtrix_tracking, [('DWI', 'in_file')]),
    # (inputnode,mrtrix_tracking,[('wm_mask_resampled','mask_file')]),
    # (mrtrix_tracking,outputnode,[('tracked','track_file')]),
    # (mrtrix_tracking,converter,[('tracked','in_file')]),
    # (mrtrix_tracking,converter,[('tracked','in_file')]),
    # (inputnode,converter,[('wm_mask_resampled','image_file')]),
    # # (converter,outputnode,[('out_file','track_file')])
    # (converter,outputnode,[('out_tracks','track_file')])
    # (mrtrix_tracking,converter,[('tracked','in_file')]),
    # (inputnode,converter,[('wm_mask_resampled','image_file')]),
    # (converter,outputnode,[('out_file','track_file')])
    (mrtrix_tracking, converter, [('tracked', 'in_tracks')]),
    (inputnode, converter, [('wm_mask_resampled', 'in_image')]),
    (converter, outputnode, [('out_tracks', 'track_file')])
    ])

    It will look something like:

sift2 = pe.Node(interface=FilterTractogram(), name='sift2')
flow.connect([
            (inputnode, mrtrix_tracking, [('DWI', 'in_file')]),
            (mrtrix_tracking, sift2, [('tracked', 'in_tracks')]),
            (inputnode, sift2, [('DWI', 'in_fod')]),
            (sift2, converter, [('out_file', 'in_tracks')]),
            (inputnode, converter, [('wm_mask_resampled', 'in_image')]),
            (converter, outputnode, [('out_tracks', 'track_file')])
        ])

This will be integrated within the next release candidate I am currently working on (see PR #45).
However, I cannot tell you exactly a date but I guess you might have all recipe to integrate it on your side in the meantime.

from connectomemapper3.

weimath avatar weimath commented on May 17, 2024

Hi,
In the "ref_diffusion_config.json" file,
when set "mrtrix_tracking_config.sift": true,
This is use tcksift in MRtrix3, but I want use tcksift2, what should I do?
Please, thank you very much

from connectomemapper3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.