OSIPI / TF2.4_IVIM-MRI_CodeCollection

OSIPI TF2.4: IVIM MRI code collection
Apache License 2.0
9 stars 27 forks source link

[Feature] Wrap image read and write #58

Closed etpeterson closed 4 months ago

etpeterson commented 5 months ago

Feature description

The fitting wrapper should be able to read and write image files. This probably would look like a small wrapper of the algorithm wrapper that loads images, sends it in, converts the output back to images, and saves it.

Describe the solution

This is the first part of this meta issue.

It should:

Describe alternatives

No response

Additional context

No response

Are you working on this?

None

Unique-Usman commented 5 months ago

thanks @etpeterson for this. I will definitely go through this and drop any question which I have.

Unique-Usman commented 5 months ago

Hello @etpeterson, thanks for the. I have some question to follow up with this.

  1. Read 4D Nifti images :- Are we taking it as paramter ?
  2. Read BIDS json files and bvector and bvalue files ? Are we taking this as parameter as well ? can you point me to any sample file for BIDS json and bvector ?
  3. Have a selectable algorithm flag:- where are the current algorithm located ?
  4. Be able to pass additional arguments into the algorithm -> I do not quite understand this
  5. Save 3D NIFTI images of the output:- Where are we getting the output from, what are we converting ?
  6. Run the current wrapper on the loaded images:- where is the location for the current wrapper?

Thank you very much.

etpeterson commented 5 months ago

Hello @etpeterson, thanks for the. I have some question to follow up with this.

  1. Read 4D Nifti images :- Are we taking it as paramter ?

Yes, a command line parameter.

  1. Read BIDS json files and bvector and bvalue files ? Are we taking this as parameter as well ? can you point me to any sample file for BIDS json and bvector ?

Yes, also parameters. I think the bids json might already contain the bvalue and bvec information, but sometimes you just have a nifti and those more simple files. https://bids-specification.readthedocs.io/en/stable/modality-agnostic-files.html https://neurostars.org/t/dmri-files-bvals-bves-file-extension/16941

  1. Have a selectable algorithm flag:- where are the current algorithm located ?

Like this, for example. https://github.com/OSIPI/TF2.4_IVIM-MRI_CodeCollection/blob/main/tests/IVIMmodels/unit_tests/test_ivim_synthetic.py#L27 Then the bvalues are input later. Right now we don't do bvectors, but that's something that will come. https://github.com/OSIPI/TF2.4_IVIM-MRI_CodeCollection/blob/main/tests/IVIMmodels/unit_tests/test_ivim_synthetic.py#L40

  1. Be able to pass additional arguments into the algorithm -> I do not quite understand this

There are a variable number of arguments for different algorithms. I'm proposing that we have an additional input on the command line that sends the arguments directly into the algorithm as kwargs. https://github.com/OSIPI/TF2.4_IVIM-MRI_CodeCollection/blob/main/tests/IVIMmodels/unit_tests/test_ivim_synthetic.py#L32

  1. Save 3D NIFTI images of the output:- Where are we getting the output from, what are we converting ?

For each voxel in the image we'll run the fitting. That will generate one voxel output. From that we build an image back up. It's done here and see how it's looped, that's the voxel loop. This save step is similar to the image save, except we'll iterate the whole image first and after save.

  1. Run the current wrapper on the loaded images:- where is the location for the current wrapper?

This is actually a little out of order, running the algorithm generates the 3D images to be saved, so that's the previous answer.

Thank you very much.