Open sgiavasis opened 5 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.
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
use_priors
orTemplate-Based
segmentation are enabled, and the tissue priors and the registration template are not in the same space, an error is thrown stopping the pipeline from running and explaining why to the user.