dipy/workflows/segment.py
def assign_bundle_labels_flow(streamline_file, labels_files, verbose=True):
    """ Show recognized bundles in their original space

    Parameters
    ----------
    streamline_file : string
    labels_files : string
    verbose : bool, optional
        Print standard output (default True)
    """
    print(streamline_file)
    print(labels_files)

    if isinstance(labels_files, string_types):
        lfiles = glob(labels_files)

    streamlines_trk = nib.streamlines.load(streamline_file)
    streamlines = streamlines_trk.streamlines

    for lf in lfiles:

        labels = np.load(lf)
        recognized_bundle = streamlines[labels.tolist()]
        recognized_tractogram = nib.streamlines.Tractogram(recognized_bundle)
        recognized_trkfile = nib.streamlines.TrkFile(
            recognized_tractogram,
            header=streamlines_trk.header)
        base = os.path.splitext(os.path.basename(lf))[0].split('_labels')[0]
        fname = os.path.join(
            os.path.dirname(lf),
            base + '_of_' + os.path.basename(streamline_file))
        nib.streamlines.save(recognized_trkfile, fname)
        if verbose:
            print('Bundle saved in \n {} '.format(fname))
 Show recognized bundles in their original space

    Parameters
    ----------
    streamline_file : string
    labels_files : string
    verbose : bool, optional
        Print standard output (default True)
    
Show recognized bundles in their original space
Parameters

streamline_file : string
labels_files : string
verbose : bool, optional
Print standard output (default True)
Show recognized bundles in their original space Parameters streamline_file : string labels_files : string verbose : bool optional Print standard output ( default True )
def assign_bundle_labels_flow(streamline_file, labels_files, verbose=True):
    print(streamline_file)
    print(labels_files)
    if isinstance(labels_files, string_types):
        lfiles = glob(labels_files)
    streamlines_trk = nib.streamlines.load(streamline_file)
    streamlines = streamlines_trk.streamlines
    for lf in lfiles:
        labels = np.load(lf)
        recognized_bundle = streamlines[labels.tolist()]
        recognized_tractogram = nib.streamlines.Tractogram(recognized_bundle)
        recognized_trkfile = nib.streamlines.TrkFile(
            recognized_tractogram,
            header=streamlines_trk.header)
        base = os.path.splitext(os.path.basename(lf))[0].split('_labels')[0]
        fname = os.path.join(
            os.path.dirname(lf),
            base + '_of_' + os.path.basename(streamline_file))
        nib.streamlines.save(recognized_trkfile, fname)
        if verbose:
            print('Bundle saved in \n {} '.format(fname))
def assign_bundle_labels_flow ( streamline_file , labels_files , verbose = True ) : print ( streamline_file ) print ( labels_files ) if isinstance ( labels_files , string_types ) : lfiles = glob ( labels_files ) streamlines_trk = nib . streamlines . load ( streamline_file ) streamlines = streamlines_trk . streamlines for lf in lfiles : labels = np . load ( lf ) recognized_bundle = streamlines [ labels . tolist ( ) ] recognized_tractogram = nib . streamlines . Tractogram ( recognized_bundle ) recognized_trkfile = nib . streamlines . TrkFile ( recognized_tractogram , header = streamlines_trk . header ) base = os . path . splitext ( os . path . basename ( lf ) ) [ 0 ] . split ( '_labels' ) [ 0 ] fname = os . path . join ( os . path . dirname ( lf ) , base + '_of_' + os . path . basename ( streamline_file ) ) nib . streamlines . save ( recognized_trkfile , fname ) if verbose : print ( 'Bundle saved in \n {} ' . format ( fname ) )
Show recognized bundles in their original space
Parameters
Show recognized bundles in their original space Parameters
""" Show recognized bundles in their original space

    Parameters
    ----------
    streamline_file : string
    labels_files : string
    verbose : bool, optional
        Print standard output (default True)
    """
streamline_file
labels_files
verbose