nipreps / nibabies

fMRIPrep-Infants - A robust, transparent workflow tailored for neonate and infant MRI
https://nibabies.readthedocs.io/en/latest
Apache License 2.0
23 stars 10 forks source link

HTML report folder structure does not work for ongoing longitudinal out of the box #350

Open tjhendrickson opened 7 months ago

tjhendrickson commented 7 months ago

What happened?

The way that the HTML reports does not work well with the use case of an ongoing longitudinal study.

For example here is screenshot of a the high level directory tree of nibabies image

Notice that the HTML report sub-XXX.html and figures folders either relate only to the subject or are within the subject folder. With this design and the proposed use case, the data for a given subject would have to be entirely re-processed each time an additional scanning session is added.

I propose the following high level directory tree to account for this: image

Perhaps you could add a flag such as --longitudinal-study-reporting that a user could specify for this? Certainly don't want to propose a change to the default structure, but it is important to consider this use case

What command did you use?

Run Nibabies on a subject with one study session and then re-run with another study session

What version of NiBabies are you using?

N/A

Relevant log output

No response

Add any additional information or context about the problem here.

No response

tsalo commented 6 months ago

Just to clarify, why would you need to reprocess all sessions each time a scanning session is added? It seems like running Nibabies with your specified session would just add to the output directory. The current directory structure doesn't seem to have anything that would conflict across sessions, since the session ID is in the HTML filename and figures should have the session ID in their names as well.

tsalo commented 6 months ago

Note from today's Nibabies meeting: there isn't a problem, since the figures will have the session entity in the filenames, but making this change would make the file organization cleaner.

EDIT: @mgxd noted that the FreeSurfer derivatives need to be organized longitudinally. EDIT 2: That's already tracked in #288.

tsalo commented 6 months ago

I've thought about it a bit more and it doesn't make sense to me to put the HTML reports inside the subject's folder, never mind the subject's session-wise folders. We don't put subject-level HTML reports in the subject folders, do we? Also, if you want to copy session-wise nibabies derivatives, you're still going to need to copy top-level files from the derivatives dataset to make sense of the session-wise derivatives anyway, so moving the HTML report doesn't affect portability.

I do think that writing out figures to the session level folder does make sense though, since you won't need to filter the subject-level figures folder when you copy out a session's data.