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

[WIP][NF] Add dipy_gtable cli #3143

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

skoudoro
Copy link
Member

@skoudoro skoudoro commented Mar 21, 2024

This PR adds a new CLI named dipy_gtable. The main goal of this cli is to merged bvec and bval into one file named *.gtab.csv. This new file will be required for the other CLI 's in a close future.

to test it, just run one this command line:

  • dipy_gtable --force dipy/data/files/small_64D.bval dipy/data/files/small_64D.bvec
  • dipy_gtable --force dipy/data/files/small_64D.bval dipy/data/files/small_64D.bvec --btens "LTE"
  • dipy_gtable --force dipy/data/files/small_64D.bval dipy/data/files/small_64D.bvec --small_delta 0.01 --big_delta 0.03 --btens "LTE"

then display the new file: dipy_info gt_condensed.gtab.csv

image

@pep8speaks
Copy link

pep8speaks commented Mar 21, 2024

Hello @skoudoro, Thank you for updating !

Cheers ! There are no PEP8 issues in this Pull Request. 🍻

Comment last updated at 2024-03-21 15:30:42 UTC

Copy link

codecov bot commented Mar 21, 2024

Codecov Report

Attention: Patch coverage is 82.56881% with 19 lines in your changes are missing coverage. Please review.

Project coverage is 81.92%. Comparing base (d75eedd) to head (85f6218).
Report is 30 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3143      +/-   ##
==========================================
+ Coverage   81.78%   81.92%   +0.14%     
==========================================
  Files         150      150              
  Lines       21277    21365      +88     
  Branches     3412     3424      +12     
==========================================
+ Hits        17401    17504     +103     
+ Misses       3037     3022      -15     
  Partials      839      839              
Files Coverage Δ
dipy/workflows/cli.py 42.85% <ø> (ø)
dipy/io/gradients.py 88.75% <91.89%> (+2.08%) ⬆️
dipy/workflows/io.py 75.00% <77.77%> (+0.21%) ⬆️
dipy/core/gradients.py 85.58% <77.77%> (-1.26%) ⬇️

... and 6 files with indirect coverage changes

@arokem
Copy link
Contributor

arokem commented Mar 21, 2024

Could we try to conform the parts that we can with https://mrtrix.readthedocs.io/en/latest/concepts/dw_scheme.html?

@skoudoro
Copy link
Member Author

Could we try to conform the parts that we can with https://mrtrix.readthedocs.io/en/latest/concepts/dw_scheme.html?

I was not aware, I will look into it and let you know.

@skoudoro
Copy link
Member Author

skoudoro commented Mar 21, 2024

ok, I just look into it @arokem,

Both are ASCII files (csv, txt, dat, etc...). So you mean:

  • space separated instead of comma separated
  • change the order (bvec, bval) instead of (bval bvec)
  • not enforce the extension instead of enforcing the extension
  • do not insert header instead of inserting header ?

Also, we add more information like btensor, small_delta, big_delta, if available.

Can you tell me which one is important to respect. I personally would like to keep the header which help non-technical user to open the file in excel and understand it. The other point should be ok to update

@arokem
Copy link
Contributor

arokem commented Mar 21, 2024

I just mean that we should spend some time thinking before we invent yet another file format.

In terms of matching the .b files, I think that we get closer by using tab separated (rather than comma-separated; also more BIDS-friendly, if I am not mistaken), and inverting the order of b-values and b-vectors.

One way to ask this is to see whether a file that is generated here could immediately be used by mrtrix, without any change. I am not sure what mrtrix does on i/o, so the added information (i.e., b-tensor) might throw this off, but it's worth trying.

@skoudoro skoudoro changed the title [NF] Add dipy_gtable cli [WIP][NF] Add dipy_gtable cli Mar 21, 2024
@skoudoro
Copy link
Member Author

ok, thank you for the feedback!

ok for tab separated and inverting b-values and b-vectors. I will update

Otherwise, I will play with other software to check what they do when the file contain extra information like btensor or b0_threshold.

@Garyfallidis
Copy link
Contributor

This is not the same purpose @arokem. Our version contains gradients, b-tensor encodings, small and big deltas etc. We will explain. And also provide a converter. Also we do not introduce a new file format. This is just a csv file. We already have pandas as a dependency.

@Garyfallidis
Copy link
Contributor

Garyfallidis commented Mar 21, 2024

Please see updated picture above (in description).

@Garyfallidis
Copy link
Contributor

In addition, it makes sense for people to see b-values as the first column because this is what people look first. It is also part of our API we first provide b-values and then b-vectors.

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

Successfully merging this pull request may close these issues.

None yet

4 participants