Different --recon-spec QSIprep

Dear experts,

I’m processing some data using QSIprep. However, I would like to run two or three --recon-spec processes simultaneously. Is this possible? I tried by adding the flag multiple times and it only seems to be reading the last one. Thanks in advance.

Best regards,

Manuel

Hi @mblesac,

Yes, you can simply combine the nodes from the JSON files that define each pipeline you want to run into your own custom JSON file, and then pass that in as your recon-spec. The pipelines can be found at qsiprep/qsiprep/data/pipelines at master · PennLINC/qsiprep · GitHub

Best,
Steven

Hi @Steven,

Thanks for your reply. To check that I’m doing this ok, assuming I want to combine the amico_noddi.json and the reorient_fslstd.json the combined will look like this?:

{ "description": "Reorients DWI, bvecs and mask into fsl standard orientation",
  "space": "T1w",
  "name": "reorient2fslstd",
  "atlases": [],
  "nodes": [
    {
      "name": "to_fslstd",
      "action": "reorient_fslstd",
      "input": "qsiprep",
      "output_suffix": "fslstd"
    }
  ]
  "description": "Runs the AMICO implementation of NODDI",
  "space": "T1w",
  "name": "amico_noddi",
  "atlases": [],
  "nodes": [
    {
      "name": "fit_noddi",
      "action": "fit_noddi",
      "software": "AMICO",
      "input": "qsiprep",
      "output_suffix": "NODDI",
      "parameters": {
        "isExvivo": false,
        "dPar": 1.7E-3,
        "dIso": 3.0E-3
      }
    }
  ]
}

Then I should just call it for example combined.json and use it like this?:

singularity run --nv -C -B /EBC:/EBC,$PWD:/opt/templateflow /EBC/home/mblesa/qsiprep-0.16.1.sif $PWD/BIDs_data $PWD/derivatives participant --participant-label ${NAME} -w $PWD --skip-odf-reports --nthreads 16 --omp-nthreads 16 --fs-license-file /EBC/local/infantFS/freesurfer/license.txt --dwi-denoise-window 7 --unringing-method mrdegibbs --output-space T1w --output-resolution 1.25 --eddy-config $PWD/eddy_params.json --recon-spec combined.json --skip_bids_validation

Best regards,

Manuel

Yes, but to be clear the way your have it set up right now, the two outputs for the FSL and NODDI outputs will be independent. That is, it is NOT the case that Preprocessed → FSL Reorient → NODDI. It is more Preprocessed → FSL and Preprocessed → NODDI in parallel. Is that okay?

Regarding your command,:

  1. you bind $PWD as /opt/templateflow, but then continue to use the name $PWD in your command. Is there a reason you do not rename all future instances of $PWD as /opt/templateflow?
  2. Similarly, you do -B /EBC:/EBC, you can just write -B /EBC.
  3. --output-space T1w is deprecated, you can remove this argument altogether
  4. Make sure that combined.json is in a drive that is mounted to Singularity so it can be found by QSIPrep.

Best,
Steven

Also, you have to make sure both nodes are contained within a single workflow, so try the following:

{
  "name": "fslreorient_and_noddi",
  "space": "T1w",
  "nodes": [
    {
      "name": "to_fslstd",
      "action": "reorient_fslstd",
      "input": "qsiprep",
      "output_suffix": "fslstd"
    },
    {
      "name": "fit_noddi",
      "action": "fit_noddi",
      "software": "AMICO",
      "input": "qsiprep",
      "output_suffix": "NODDI",
      "parameters": {
        "isExvivo": false,
        "dPar": 1.7E-3,
        "dIso": 3.0E-3
      }
    }
  ]
}

reorienting to fsl shouldn’t be used as input to any of the recon workflows. These are all designed to work directly on qsiprep output and are expecting the images and bvecs, etc in the orientation that qsiprep uses. reorient_fslstd should only be used to get the preprocessed data in a format that will be interpreted correctly by FSL tools.

Hi @Steven and @mattcieslak,

Thanks for your replies. That was my idea, reorient for future analysis and in the same raw data calculate the NODDI maps, I can later apply fslreorient2std (I assume this is what reorient_fslstd does) to the NODDI maps to align them with the other maps and using them for any tract analysis, TBSS or things like that. Is this what the json file provided by @Steven does?

Best regards,

Manuel

No, the json I provided does the steps in parallel, both acting on the preprocessed outputs (as evidenced by both nodes having input: “qsiprep”). Perhaps if you make the input for the FSL node have input of fit_noddi? Otherwise you can just run the FSL reorient command on your outputs afterwards.

The fsl reorientation node is pretty limited in scope, it will only take preprocessed data and reorient it to LAS+ along with the bvecs. This should be easy to do on your own to the results from the noddi workflow, since most are just scalar images.

Hi,

Thanks for your replies! everything works now!

Best regards,

Manuel

1 Like