population template error, non-linear registration

Dear experts,
I ran the FBA pipeline for a cohort of 20 subjects and everything went smoothly. But when I added 4 more subjects and error occured when running the population_template command.

The error showed as followng in the non-linear registration step of the population_template command.
mrregister: SH image input pair /fba/template/fod_input/Subject_005.mif, nl_template06_c0.mif
mrregister: performing FOD registration
mrregister: [ERROR] Permission denied
mrregister: [ERROR] error opening image “warps_05/Subject_005.mif”

I checked the permission for the warps_05/Subject_005.mif and they are

I tried to use chmod 777 for all the files within warps_05 and used the -continue option to run the population_template. It went through the non-linear registration using the files in warps_05/. But error happened again
when the program generated new files in the folder warps_06 and tried to use them. It seemed that the population_template command does the non-linear registration several times and generate new warps file at each iterative step.

Can anybody help me out of this? Or is there any other possible way to solve this problem?

Thank you very much!


1 Like

Welcome @lijiang!

  • In the addition of 4 more subjects, are you simply re-running population_template from the start, with 4 more subjects than what was used previously, and yet the script is encountering an error for one of the subjects that was included in the original successful execution (which I’m guessing based on “Subject_005”)? If so the addition of more subjects might be a red herring; it might be more simply that “it worked the first time, but not the second time”. But it’s hard to know without performing repeat attempts of both scenarios.

  • If you want to rule out any sort of issue w.r.t. permissions, you might want to recursively change permissions for the whole scratch directory, so that there will also not be any issue with writing new files.

  • Is my understanding of your phrasing correct in that, upon using the -continue option, the script is in fact making non-zero progress, and it is essentially making its way through one complete non-linear iteration, then encounters the same error, at the same line of code, but within the subsequent iteration? Is it the same subject for which the error occurs, or a different one? If that is indeed the case, that is very unusual. The “warps_*/” directories are all created at the commencement of the script using the same function, so one would expect them to all have the same permissions, and encountering an error at an iteration other than the first one is therefore quite strange.

  • If the addition of those four subjects is not expected to change the resulting template drastically, one option is to use the template that you have, but instead perform an explicit mrregister call for all 24 subjects; as though your original 20 subjects were chosen as a representative subset of the whole cohort.

  • Since the error is quite unusual, if there is indeed some problem somewhere at our end, you would need to confirm at least that you are able to reproduce the fault. If your filesystem permissions were toggled by e.g. a rogue solar neutrino, and simply re-running the script from the start does not reproduce the issue, then there’s nothing we can do really.

  • If you’re determined to complete the script without restarting from the beginning, I suppose you could try manually changing permissions and -continue-ing for each non-linear iteration. Very clumsy if you’re e.g. using a job scheduler, but if it’s running on your own system, there’s nothing stopping you from trying.


EDIT: Conversation to continue in another thread.