open-discussion > Changing default protocol before QC without GUI
Showing 1-7 of 7 posts
Display:
Results per page:
Jul 22, 2020  08:07 PM | Steven Meisler - Harvard University / MIT
Changing default protocol before QC without GUI
Hi,

I am trying to run DTIPrep (1.2.10) in sbatch background jobs. For each subject, I use the -c and -d arguments to forego the need of any GUI, but I also now see that for my protocol, I should disable the eddy/motion correction and enable the dominant directional artifact check. Is there a way to have DTIPrep generate the default protocol without running QC, allowing me to edit it in command line, and then have QC run? I realize that I could make my own xml file for a study, but parameters such as IMAGE_directions vary between subjects.

I should note that I tried a line in the wiki which suggested to use only the -w -d and -p arguments to generate a protocol without running a check, but upon running, the GUI opened and nothing else happened.

Thanks,
Steven
Jul 27, 2020  09:07 PM | Martin Styner
RE: Changing default protocol before QC without GUI
Originally posted by Steven Meisler:
Hi,

I am trying to run DTIPrep (1.2.10) in sbatch background jobs. For each subject, I use the -c and -d arguments to forego the need of any GUI, but I also now see that for my protocol, I should disable the eddy/motion correction and enable the dominant directional artifact check. Is there a way to have DTIPrep generate the default protocol without running QC, allowing me to edit it in command line, and then have QC run? I realize that I could make my own xml file for a study, but parameters such as IMAGE_directions vary between subjects.

I should note that I tried a line in the wiki which suggested to use only the -w -d and -p arguments to generate a protocol without running a check, but upon running, the GUI opened and nothing else happened.

Thanks,
Steven
Jul 29, 2020  10:07 PM | Steven Meisler - Harvard University / MIT
RE: Changing default protocol before QC without GUI
Hi Martin,

I see that you made a reply but I don't see any text (besides my original question quoted). Was there supposed to be something there?

Thanks,
Steven
Jul 29, 2020  10:07 PM | Martin Styner
RE: Changing default protocol before QC without GUI
Trying again, my first reply did not post correctly. This time I will try to be more concise (maybe my reply was too long):

1) -d should be used for generating & writing out a default protocol. It should NOT be used to run DTIPrep with a default protocol. DTIPrep investigate   is the data to come up with thresholds for the default protocol and thus those thresholds are scan specific.
2) you should use the same protocol to run DTIPrep across a whole study. -d will run slightly different protocol (scan specific protocols), so do not use "-d" in that fashion
3) best use -d to generate a protocol, manually edit it (using DTIPrep's GUI) (e.g. to disable certain stages) and then save it for later use
4) then use -p to run it on the command line

Best
Martin
Originally posted by Steven Meisler:
Hi,

I am trying to run DTIPrep (1.2.10) in sbatch background jobs. For each subject, I use the -c and -d arguments to forego the need of any GUI, but I also now see that for my protocol, I should disable the eddy/motion correction and enable the dominant directional artifact check. Is there a way to have DTIPrep generate the default protocol without running QC, allowing me to edit it in command line, and then have QC run? I realize that I could make my own xml file for a study, but parameters such as IMAGE_directions vary between subjects.

I should note that I tried a line in the wiki which suggested to use only the -w -d and -p arguments to generate a protocol without running a check, but upon running, the GUI opened and nothing else happened.

Thanks,
Steven
Jul 30, 2020  10:07 PM | Steven Meisler - Harvard University / MIT
RE: Changing default protocol before QC without GUI
If thresholds are determined upon running DTIPrep and not generating the protocol, does that mean if I have several studies I want to do QC for, that I can use a single protocol.xml file? I would turn off the image and diffusion bchecks since that would likely fail if I use a study that has different acquisition parameters than the .nrrd I use to generate the original .xml.

My main goal is to only run baseline averaging, and the automated gradient removal steps (slicewise, interlace, gradient, dominant direction).

*Edit*
I have since tried to use a protocol from one study on another, and it didn't look like relevant thresholds (like interlace correlation threshold) were updated.

I cannot seem to create a default protocol without loading a subject first, so to me it seems like it would cause all thresholds for the study to be set for that subject it I were to only use the one protocol.

Is there either 1) a method of loading all subjects to DTIPrep and then generating a protocol so the thresholds are appropriate for the whole cohort, or 2) a way to have DTIPrep calculate these thresholds upon execution as opposed to reading from the protocol? Or am I thinking about this the wrong way?

Thanks,
Steven
Jul 31, 2020  01:07 PM | Martin Styner
RE: Changing default protocol before QC without GUI
Sorry for not being clear:
- the thresholds are specified in the protocol. Using the same protocol means that you apply the same thresholds (which is necessary within a study)
- using "-d" generates a protocol. The thresholds in that protocol are based on the dataset provided when you run "-d" (or when you use the "default protocol" button in the GUI). 
- You don't want to have thresholds computed for every dataset within a single study, but rather use consistent thresholds (i.e. same protocol file)
- the default protocols generate thresholds based on our DWI knowledge back before 2010. My 2020 knowledge tells me that those thresholds are a bit aggressive (particularly for the infant studies that we run) and thus we manually change them to be more permissive.
- There is no need to generate a default protocol, if you have already a protocol. Just load/use that protocol you have.

Re reusing protocol files:
- we do that all the time, if the studies are on a similar level of  SNR (similar acquisitions, similar age range) & motion artifact (similar scanning setting, study population is not expected to impact motion tremendously). 

Additional tips:
- we rarely run the gradient checking step these days(which checks for residual motion that was not corrected in the motion/eddy current correction) as it does not work well on higher shells (and often removes low SNR data in b>2000 shells)
- dominant direction checks needs training data to compute thresholds, and thus is a lot of work on your part. Only needed if you suspect there is an issue with your data (this would be visually evident if you look at the color-FA images). It was a big issue 2005-2010 years, but I rarely see datasets with this issue these days (I think scanner manufacturers solved the problem).

I hope this made things a bit clearer and I did not further sow confusion.

Martin
Originally posted by Steven Meisler:
If thresholds are determined upon running DTIPrep and not generating the protocol, does that mean if I have several studies I want to do QC for, that I can use a single protocol.xml file? I would turn off the image and diffusion bchecks since that would likely fail if I use a study that has different acquisition parameters than the .nrrd I use to generate the original .xml.

My main goal is to only run baseline averaging, and the automated gradient removal steps (slicewise, interlace, gradient, dominant direction).

*Edit*
I have since tried to use a protocol from one study on another, and it didn't look like relevant thresholds (like interlace correlation threshold) were updated.

I cannot seem to create a default protocol without loading a subject first, so to me it seems like it would cause all thresholds for the study to be set for that subject it I were to only use the one protocol.

Is there either 1) a method of loading all subjects to DTIPrep and then generating a protocol so the thresholds are appropriate for the whole cohort, or 2) a way to have DTIPrep calculate these thresholds upon execution as opposed to reading from the protocol? Or am I thinking about this the wrong way?

Thanks,
Steven
Aug 3, 2020  08:08 PM | Steven Meisler - Harvard University / MIT
RE: Changing default protocol before QC without GUI
Got it, makes sense and thanks for the tips! I have been looking at papers that cite DTIPrep, and unfortunately I am having trouble finding any that report what thresholds they used. When your group designs a protocol for the study, do you have any rules of thumb for setting these limits (particularly the interlace correlation thresholds)?