FCP-INDI / C-PAC

Configurable Pipeline for the Analysis of Connectomes
https://fcp-indi.github.io/
GNU Lesser General Public License v3.0
63 stars 41 forks source link

Place a check to ensure template-space tissue priors are in same space as registration templates #1041

Open sgiavasis opened 5 years ago

sgiavasis commented 5 years ago

Related problem

When a user enables the use of tissue priors to refine the segmentation masks, or when they select template-based segmentation, CPAC will use the supplied tissue priors, which are binary tissue masks in template space. Users can also provide custom priors, if they are using a different template that these priors were based on.

These template-space segmentation masks are then transformed to the individual-space (either T1 or EPI based on the pipeline) using the inverse T1-to-template or EPI-to-template transforms calculated during registration.

The problem arises when a user provides a custom template for registration, but does not provide new tissue priors or template-space segmentation masks that match this custom template. Or, the problem arises if custom template-space tissue masks are provided, but the registration template is not changed to match. CPAC will continue on and the transformation of the template-space segmentation masks to individual T1 or EPI space will fail.

Proposed feature

Place a check to ensure the tissue priors/templates are in the same space as the registration templates, but only if use_priors or Template-Based segmentation are enabled.

Acceptance criteria

sgiavasis commented 3 years ago

Following a conversation with @zpsheldon, we realized a few more cross-checks needed.

This would all be only if these measures are enabled; for example, check the third only if Template_Based segmentation is enabled, and EPI_Template chosen, along with EPI registration.

It's actually a good idea to have the registration templates + masks checked against each other as well.