PennLINC / qsirecon

Reconstruction of preprocessed q-space images (dMRI)
https://qsirecon.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
5 stars 3 forks source link

[ENH] Add BabyAFQ #17

Open mattcieslak opened 5 months ago

mattcieslak commented 5 months ago

I hope to add a BabyAFQ recon workflow. @arokem and @36000 I have a question:

Does the current AFQ workflow download the bundle ROIs on the fly? If it does, would it make sense to add them to the qsiprep docker image? I will do the same with the BabyAFQ regions, whichever you prefer.

36000 commented 5 months ago

Yes, you are correct, I wrote something for the CLI that handles this. It would make sense to add a call to pyAFQ to the docker image like this:

pyAFQ download

That causes the CLI to call this function which will download all the templates for babyAFQ and normal AFQ: https://github.com/yeatmanlab/pyAFQ/blob/899d504c7b75cca7a41f3c48daed9c614754d762/bin/pyAFQ#L117

mattcieslak commented 5 months ago

@36000 pyAFQ download is amazing. Did that get the baby atlases too?

36000 commented 5 months ago

Yup! It gets the baby atlases. I wrote it for my own docker images, this is its exact intended use.

mattcieslak commented 5 months ago

@36000 I think something may have changed in pyAFQ such that the config from qsiprep doesn't work anymore. I added pyAFQ download to the DockerFile and there is a /home/qsiprep/AFQ_data that has the ROIs.

Here the error always ends with TypeError: bundle_info must be a dict, or a BundleDict. I tried changing the config file here but there is still a problematic bundle_info somewhere. Any ideas?

mattcieslak commented 5 months ago

aha, it looks like in the CI tests when using the --sloppy flag bundle_info gets set to 'bundle_info': ['SLF_L', 'ARC_L', 'CST_L', 'CST_R'], which is indeed not a dict. What is this arg supposed to look like if I only want to test for a couple bundles?

36000 commented 5 months ago

Ah! Them being a list is actually fine as the software should convert them to a dict. The problem is we got rid of the acronyms. There is a way to calculate an updated JSON. You run pyAFQ -q. For this list, you would need to update it to:

['Left Superior Longitudinal', 'Left Arcuate', 'Left Corticospinal', 'Right Corticospinal']

I went ahead and generated some updated JSON's off the pyAFQ master. pyafq_input_trk.json pyafq.json

36000 commented 5 months ago

Oh - actually - i lied. You do need to instantiate a bundledict and pass it to pyAFQ if you want a subset. Please hold while I find the syntax.

36000 commented 5 months ago

The line should be:

"bundle_info": 'default18_bd()["Left Superior Longitudinal", "Left Arcuate", "Left Corticospinal", "Right Corticospinal"]'
mattcieslak commented 4 months ago

That did it! Thank you @36000

mattcieslak commented 4 months ago

One more question - do I need to install pyafq in a different way in order to be able to make the plots? I'm installing pyafq here

36000 commented 4 months ago

which plots? For the plotly html files we generate, this will work. There are other plots that require optional installations.