nipype icon indicating copy to clipboard operation
nipype copied to clipboard

Freesurfer longitudinal pipeline - ReconAll flags

Open 0rC0 opened this issue 4 years ago • 7 comments
trafficstars

Summary

Hello everybody,

I'm going to implement the flags for the Freesurfer longitudinal pipeline in ReconAll.

I would like to ask if there is interest in a pull request about that.

Actual behavior

The Freesurfer longitudinal pipeline needs recon-all flags like -base -tp -long, whose are not implemented yet.

0rC0 avatar Jun 18 '21 19:06 0rC0

Hi, yes, these would be a great addition.

effigies avatar Jun 20 '21 11:06 effigies

We are also interested by this interface. Is it still in the works?

Otherwise, we would be keen in giving it a go to replace our custom subprocess calls in Clinica.

ghisvail avatar May 16 '22 08:05 ghisvail

We are also interested by this interface. Is it still in the works? Otherwise, we would be keen in giving it a go to replace our custom subprocess calls in Clinica.

Hello,

I'm not working any more on this addition.

Freesurfer uses and wants a somehow fixed directory structure. For example, the command worked if the structure was:

subjects_dir
|
|-sub1-timepoint1
|-| -mri
  |-stats
  |-....
|- sub1-timepoint2
|-| -mri
  |-stats
  |-....

but not for other structures, and I didn't manage to write something enough flexible to be integrated in a nipype workflow or the directory structure of the temp files of a workflow.

0rC0 avatar May 19 '22 12:05 0rC0

Hello, I've also been interested in working on this for a while and have some basic code going that creates a separate "base" and "longitudinal" interface specification. FreeSurfer does generate specific output directory structures but I'm not entirely sure what other folder structures would cause this to not work. At any rate, would be happy to discuss if this issue is still of interest to others.

l-espana avatar Nov 22 '22 20:11 l-espana

I've also been interested in working on this for a while and have some basic code going that creates a separate "base" and "longitudinal" interface specification. FreeSurfer does generate specific output directory structures but I'm not entirely sure what other folder structures would cause this to not work.

@l-espana if you have already got code that works, that would be a great starting point for a PR to iterate upon.

I have been focusing on pydra-freesurfer with plans to backport the longitudinal interface back to Nipype eventually, if no one beats me to it before. Feel free to have a go 👍

ghisvail avatar Nov 23 '22 13:11 ghisvail

Sorry, I have pressed close for a mistake :P. I reopen it

If someone is still working or want to work to this issue and have some code to share to start with, I would be happy to give my contribution :-).

Anyway, my main problem was the following. Let's imagine we have a workflow that runs the single-subject recon-all, so, we have the two recon-all directories in paths like:

/workflow_temp/some1/path1/reconall/sid.baseline (1)
/workflow_temp/some2/path2/reconall/sid.followup (2)

The longitudinal pipeline of Freesurfer uses commands like:

  recon-all -base sid_templace -tp sid.baseline -tp sid.followup  -all
  recon-all -long sid.baseline sid_template -all
  recon-all -long sid.followup sid_template -all

and needs that the folders sid.baseline, sid.followup, sid.template are subfolders of $SUBJECTS_DIR, that should be the workflow temp directory of our longitudinal recon-all node

0rC0 avatar Nov 28 '22 12:11 0rC0

I guess I would question leaving recon-all outputs in a temporary workflow directory rather than using, say, a freesurfer derivatives directory and just referencing that as the $SUBJECTS_DIR. (Unless I'm completely misunderstanding...) Working with FreeSurfer data in the past, we usually have to make sure all of the original recons pass inspection before running the rest of the longitudinal pipeline anyways, so it makes sense to me to keep things separated. I'm close to opening a PR I think, so maybe we can continue discussing. :)

l-espana avatar Nov 29 '22 20:11 l-espana