Skip to content

NF: nib-convert CLI tool #1113

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

Merged
merged 5 commits into from
Jun 13, 2022
Merged

NF: nib-convert CLI tool #1113

merged 5 commits into from
Jun 13, 2022

Conversation

effigies
Copy link
Member

@effigies effigies commented Jun 7, 2022

In #1089 we proposed:

Provide nib-cast (name may change) command-line tool to recast existing files to new data type

Also found an error in NIfTI writing if get_data_dtype(finalize=True) wasn't called prior to to_file_map().

@pep8speaks
Copy link

pep8speaks commented Jun 7, 2022

Hello @effigies, Thank you for updating!

Cheers! There are no style issues detected in this Pull Request. 🍻 To test for issues locally, pip install flake8 and then run flake8 nibabel.

Comment last updated at 2022-06-13 17:14:28 UTC

@effigies effigies changed the title ENH: nib-convert CLI tool NF: nib-convert CLI tool Jun 7, 2022
@codecov
Copy link

codecov bot commented Jun 7, 2022

Codecov Report

Merging #1113 (9a9a590) into master (b7bbf0e) will increase coverage by 0.02%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master    #1113      +/-   ##
==========================================
+ Coverage   92.30%   92.32%   +0.02%     
==========================================
  Files         100      101       +1     
  Lines       12342    12380      +38     
  Branches     2419     2423       +4     
==========================================
+ Hits        11392    11430      +38     
  Misses        625      625              
  Partials      325      325              
Impacted Files Coverage Δ
nibabel/cmdline/convert.py 100.00% <100.00%> (ø)
nibabel/nifti1.py 92.63% <100.00%> (+0.06%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b7bbf0e...9a9a590. Read the comment docs.

@effigies
Copy link
Member Author

Can I interest anyone in a review? Want to get this in for 4.0 as it includes a fix.

Copy link
Member

@arokem arokem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, looks good. I had a couple of small comments.

convert.main([str(infile), str(outfile)])

convert.main([str(infile), str(outfile), '--force'])
assert outfile.is_file()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not too important, but is there a way to make sure that this is the file that was created in the forced run, and not the one that existed there before? You might worry that the force flag would somehow make the program do nothing.

"a new image like `infile` will be created and converted to a type "
"matching the extension of `outfile`.")
p.add_argument("-f", "--force", action="store_true",
help="Ignore warnings if possible")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also forces over-writing existing files. Might want to mention that here.

@effigies
Copy link
Member Author

Thanks @arokem. I think I addressed both of your concerns. Please have another look when you get a minute.

@arokem
Copy link
Member

arokem commented Jun 13, 2022

Yep. This looks good to me and I am +1 to merge. Does nibabel have a protocol about needing additional reviewers, or should I hit "merge"?

@effigies
Copy link
Member Author

Nope, one reviewer is enough, unless several people have been active in the discussion. (We have some docs here now: https://nipy.org/nibabel/devel/core_developer.html#reviewing)

@arokem
Copy link
Member

arokem commented Jun 13, 2022

Got it! Thanks. I'll wait on that one remaining CI run and then hit the merge button.

@arokem arokem merged commit 669a030 into nipy:master Jun 13, 2022
@effigies effigies deleted the enh/nib-convert branch June 13, 2022 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants