Population_template non-linear registration

Dear All,

Hope you’re well.

I have been following the standard preprocessing pipeline for single-tissue CSD here, and I am currently at the stage of building the population template. I have selected 30 images (15 controls, 15 patients) out of a total of 72 images for template building. Whereas the rigid and affine registration stages finish successfully in less than a day, the non-linear registration stage is alarmingly slow - for example, checking the “warps_00” folder (out of “warps_00”-“warps_15”), it is taking 1h20m to create a single .mif file, so it could potentially take a month to finish the stage of optimising the template with non-linear registration.

The images have been upsampled from 2 to 1.25 mm iso, and I have been using subject masks too that have been minimally edited. For template building, I have deliberately selected patient images with minimal evidence of structural abnormalities.

It’s definitely not a storage issue (tens of GBs of storage space), and my CPU’s RAM is decent (installed physical memory: 16 GB; total virtual memory: 31GB).

My question would be whether it’s a huge “no-no” to modify the population_template command with the option of “-type rigid_affine” to bypass non-linear registration altogether.

many thanks for your help

georgios

Hi Georgios,

One option to speed up this step is to conduct the registration/transformation in parallel (as opposed to processing each subject in series). This is possible because the registration of a given subject to the population template is independent to the subsequent subject(s).

So, if using HPC (or slurm), instead of submitting one large job (that would take around a month to finish), consider submitting a separate registration/transformation job for each subject (which would still take ~1h20min, but the subjects are warped simultaneously - thereby substantially reducing the total time).

Note - this approach works on HPC (or slurm) because there are designated resources allocated to each job. It may not be advantageous if each job is competing with every other job for resources.

Hope this helps!

Cheers,
Arkiev

many thanks, Arkiev, much appreciated!
g

1 Like

Dear Arkiev,
I would like to followup on your recommendation:
How would you exactly set up the population_template command to perform the simultaneous warping? Because after warping of each subject, a new non-linear template has to be created, and used as new target, if I understand the population_template process correctly.
Your answer is very much appreciated!
Best
Frauke

Hi Frauke,

Maybe have a look at Steven Meisler’s FBA scripts for inspiration and guidance:

Cheers
William

1 Like

@WilliamFCB thanks for highlighting this resource

Welcome to the forum @Beyer_Frauke!

The simultaneous warping process isn’t directly applied during the population template step itself, which can be time-consuming. I’m unsure if simultaneous processing is feasible for this step…

However, once the population template is created, the subsequent step (where each subject is registered and transformed into the template space) can indeed be done simultaneously. This is because there is an established common “target” for all participants, and each participant’s registration to this target operates independently of the others :blush:

Hope this helps!

Cheers,
Arkiev