Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Wrap image read and write #58

Closed
etpeterson opened this issue Mar 13, 2024 · 3 comments · Fixed by #60
Closed

[Feature] Wrap image read and write #58

etpeterson opened this issue Mar 13, 2024 · 3 comments · Fixed by #60

Comments

@etpeterson
Copy link
Contributor

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:

  • Read 4D NIFTI images
  • Read BIDS json files and bvector and bvalue files
  • Have a selectable algorithm flag
  • Be able to pass additional arguments into the algorithm
  • Save 3D NIFTI images of the output
  • Accept command line arguments for all of the above
  • Run the current wrapper on the loaded images

Describe alternatives

No response

Additional context

No response

Are you working on this?

None

@Unique-Usman
Copy link
Contributor

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

@Unique-Usman
Copy link
Contributor

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
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants