This process embed four bundles filtering tools for changing referential, fascicle selection and splitting according to regions crossed and fascicle length filtering.
Bundles of fascicle produced by BrainVISA tracking algorithms often need to be transformed before they are analysed. This process contains a series of filters taking one bundles file (in
bundles
parameter) and producing one modified bundle file (intransformed_bundles
parameter). Each filter is optional. If the parameters of a filters are empty, the corresponding filtering step is skipped. The filters are organized and linked together with the following structure :A - Bundles geometrical transformation
This filter apply an affine transformation to a bundle set. The parameter of this step is a transformation matrix. This transformation is applied to each point of each fascicle of all bundles.
B - Bundles selection and reorganization
This filter can reorganize fascicles according to the 3D region of interest (ROI) they cross. For example, it can be used to separate fascicles intersecting region A and region B from fascicles touching only region A. The input of the selection filter is a set of ROI (in
selecion_regions
parameter), an optional transformation to apply to the ROI (inselecion_regions_transformation
) and a selection rules file (inselecion_rules
).We hope to have time to build a graphical interface to let users easily build its selection criteria. But to date, these criteria must be written in a fascicle selection rules file. This file contains a series of rules. Each rule contains a bundle name and a selection criterion. The selection criterion can either accept or reject a fascicle. This filter uses the selection rules to transform a set of fascicle bundles in another set of fascicle bundles with the following algorithm:
For each bundle in the input bundles: For each fascicle in bundle: rule = first rule in the selection rule files with a criterion accepting fascicle if rule exists: put fascicle in the resulting set of fascicle bundles in a bundle whose name is rule's bundle name else: fascicle is deleted (i.e. not inserted in the resulting set of fascicle bundles)The selection rules file is a text file containing one fascicle selection rule per line. The syntax of a selection rule is composed of three parts :
bundle_name region_count_selection region_names
bundle_name
is the name of the bundle in which all fascicles accepted by the rule will be put in the output bundles set. In this name, any*
(star) character is replaced by the bundle name containing the fascicle in the input bundles set. Ifbundle_name
contains only a-
(minus), the accepted fascicle are removed (not put in the output bundles set). Any?
(question mark) character is replaced by the name of all the regions crossed by the fascicle (separated by dots).region_count_selection
allows to accept fascicle according to the number of different regions it cross. This field is composed of two numbers:minimum_crossed
andmaximum_crossed
. A fascicle is rejected by this rule if it cross less thanminimum_crossed
regions or more thanmaximum_crossed
regions. Using zero formaximum_crossed
means infinite maximum number of region crossed. Therefore using0 0
forlength_selection
means no selection on the number of regions crossed. Note that thebackground
counts as a region.region_names
is composed of a series (possibly empty) of region names. These names must belong to the ROI file given in theselection_region
parameter. The namebackground
is also accepted to identify the points not belonging to any input region. The rule accepts a fascicle only if it cross (i.e. touch) all the listed regions.Selection rules examples
It may be easier to understand how selection rules file work on some examples than on the previous detailed description. Let's consider that the input bundle set is composed of two bundles (
bundle1
andbundle2
) and thatselection_regions
contains a set of three regions (r1
,r2
andr3
) as shown in the following figure:Example 1
In order to select all fascicles touching a ROI, it is possible to use a single line selection rule file :
touch_r1 0 0 r1With this file all fascicles touching
r1
are put in a bundle namedtouch_r1
whereas all other fascicles are deleted. The result is the following single bundle:Example 2
The previous example can be modified to separate fasicles in two bundles:
- all fascicles touching only
r1
are put intouch_r1
- and all fascicles touching
r1
and at least another region are put intouch_r1_and_another
touch_r1_and_another 3 0 r1 touch_r1 0 0 r1In the first rule,
minimum_crossed
is set to 3 because thebackground
counts as a region. This example shows the importance of the order of the rules. If thetouch_r1
rule had been put first, the result would have been the same as the previous example (because the first rule accepting a fascicle is used to determine its bundle name).Example 3
touch_r1_r3 0 0 r1 r3 touch_r2_r3 0 0 r2 r3With the above selecion rules, all the fascicles touching
r1
andr3
will be put intouch_r1_r3
bundle. All other fascicles crossing bothr2
andr3
will be put intouch_r2_r3
:Example 4
It is possible to use the same bundle name on several rule to combine several selection criteria on the same bundle.
r1_r2 0 0 r1 r2 r1_r2_r3 0 0 r1 r3 r1_r2_r3 0 0 r2 r3Example 5
It is to select fascicles and keep the initial bundle organization by using a
*
in the bundle name. For example, the following single rule keeps the separation between fascicles inbundle1
and fascicles inbundle2
.*_touch_r1_r2 0 0 r1 r2Example 6
The question mark in the bundle name can be used to separate fascicles without a priori knowledge of the region crossed. The question mark is replaced by the name of all the regions crossed by the fascicle (separated by dots).? 0 0C - Fascicle splitting
To assess the connectivity between ROIs it is sometimes useful to select only some parts of the fascicles created by tracking algorithms. This filter separate fascicles in several parts that can be analysed individually.
First, the fascicle are cut on the ROI boundaries. Then, the fascicle parts are grouped into bundles according to the two regions touched by their extremities. All fascicle parts touching the same pair of ROI will be in the same bundle, this bundle has the name of the two ROI separated by an underscore character. The ROI set is given in the parameter
split_regions
(and the optional transformationsplit_regions_transformation
).For example, the following figure shows the splitting of a set of two fascicles bundles on a set of two regions:
In this example a bundle set composed of five bundles is produced. Each bundle contains all the fascicle parts joining two regions (or one region and the background). Therefore, the bundle named
a.b
can be used to study the putative fascicle connectivity between regiona
and regionb
(see Diffusion Bundles Analysis in Fascicles Tracking Pipeline).In the previous example, all the fascicles are processed independantly of their bundle organisation. Therefore the original bundle organisation can be lost by the splitting process. If one wants to keep this bundle organisation, he must set
split_keep_original_bundle
totrue
. In that case, the output bundle name of a fascicle is prefixed by the name of the bundle containing the fascicle. This is illustrated in the following example:D - Small fascicle removal
All fascicle which length is shorter thanminimum_length
millimeters are simply removed.
bundles: Fascicles bundles ( entrée )Input bundles file
bundles_transformation: Transformation matrix ( optional, entrée )Referential transformation applied to each fascicle point.
selection_regions: ROI ( optional, entrée )ROI set used for selection.
selection_regions_transformation: Transformation matrix ( optional, entrée )Referential transformation applied toselection_regions
.
selection_rules: Bundle Selection Rules ( optional, entrée )File containing a set of rules used to select fascicles and reorganize bundles.
selection_overlap: Nombre ( input )In the selection process, percentage of point of a fascicle that have to be in a ROI to consider that the ROI is touched by the fascicle. 0 (the default) means that only one point in the ROI is engough, and 100 mean that all the fascicle points must be inside a ROI.
split_regions: ROI ( optional, entrée )ROI set used for fascicle splitting.
split_regions_transformation: Transformation matrix ( optional, entrée )Referential transformation applied tosplit_regions
.
split_keep_original_bundle: Booléen ( input )
minimum_length: Réel ( optional, input )Remove all fascicles shorter thanminimum_length
millimeters.
transformed_bundles: Fascicles bundles ( sortie )Output bundles produced by the various filtering steps.
ascii_bundles_file: Booléen ( input )Bundles files can be either in binary (the default) format or in ascii format (ifascii_bundles_file
istrue
). The former is much smaller and therefore more efficient. But it may be easier to use ascii format if you plan to create your own programs using bundles as input.
Toolbox : Diffusion et Tractographie
Niveau d'utilisateur : 1
Identifiant :
DiffusionBundleTransformation
Nom de fichier :
brainvisa/toolboxes/connectomist/processes/Tracking Pipeline Components/DiffusionBundleTransformation.py
Supported file formats :
bundles :Aims bundlesbundles_transformation :Transformation matrixselection_regions :GIS image, Z compressed GIS image, gz compressed GIS image, VIDA image, NIFTI-1 image, gz compressed ECAT i image, MINC image, gz compressed MINC image, DICOM image, TIFF image, XBM image, PBM image, PGM image, BMP image, XPM image, PPM image, gz compressed NIFTI-1 image, TIFF(.tif) image, Graph and data, gz compressed VIDA image, Z compressed VIDA image, Z compressed ECAT i image, gz compressed ECAT v image, ECAT i image, Z compressed ECAT v image, PNG image, JPEG image, MNG image, GIF image, Z compressed SPM image, SPM image, gz compressed SPM image, ECAT v imageselection_regions_transformation :Transformation matrixselection_rules :Bundle Selection Rulessplit_regions :GIS image, Z compressed GIS image, gz compressed GIS image, VIDA image, NIFTI-1 image, gz compressed ECAT i image, MINC image, gz compressed MINC image, DICOM image, TIFF image, XBM image, PBM image, PGM image, BMP image, XPM image, PPM image, gz compressed NIFTI-1 image, TIFF(.tif) image, Graph and data, gz compressed VIDA image, Z compressed VIDA image, Z compressed ECAT i image, gz compressed ECAT v image, ECAT i image, Z compressed ECAT v image, PNG image, JPEG image, MNG image, GIF image, Z compressed SPM image, SPM image, gz compressed SPM image, ECAT v imagesplit_regions_transformation :Transformation matrixtransformed_bundles :Aims bundles