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

Cannot Run totalspineseg with Directory of .nii Files #57

Open
simonqueric opened this issue Sep 17, 2024 · 3 comments
Open

Cannot Run totalspineseg with Directory of .nii Files #57

simonqueric opened this issue Sep 17, 2024 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@simonqueric
Copy link

simonqueric commented Sep 17, 2024

I noticed that running totalspineseg with a directory containing .nii instead of .nii.gz files doesn't work.
Although the documentation of TotalSpineSeg is clear, I think it would be good to include the case where the data directory contains .nii files.

image

Steps to reproduce the issue

  1. Create a data directory data with one .nii file
  2. Run totalspineseg data output
@simonqueric simonqueric added the enhancement New feature or request label Sep 18, 2024
@yw7
Copy link
Collaborator

yw7 commented Sep 18, 2024

Hi @simonqueric,

Thank you for bringing up this issue!

You make a good point. While the TotalSpineSeg documentation specifies the use of .nii.gz files, it would indeed enhance usability to support .nii files as well.

Currently, as we're focusing on integrating TotalSpineSeg into SCT (Spinal Cord Toolbox), our primary goal is to improve the labeling functionality. Supporting additional input formats like .nii is definitely something we can consider for future updates.

In the meantime, you can easily convert your .nii files to .nii.gz using tools like mri_convert from FreeSurfer. Here's a simple bash loop that can help:

for f in path/to/input/folder/*.nii; do mri_convert $f ${f}.gz; done

This will convert all .nii files in your input folder to .nii.gz format.

@yw7 yw7 closed this as not planned Won't fix, can't repro, duplicate, stale Sep 28, 2024
@NathanMolinier
Copy link
Collaborator

NathanMolinier commented Jan 6, 2025

I believe we should come up with a quick fix for this

spinalcordtoolbox/spinalcordtoolbox#4756

@NathanMolinier NathanMolinier reopened this Jan 6, 2025
@yw7
Copy link
Collaborator

yw7 commented Jan 6, 2025

I believe we should come up with a quick fix for this

spinalcordtoolbox/spinalcordtoolbox#4756

I think it will be easy to make small adjustments to this lines to support nii

https://github.com/neuropoly/totalspineseg/blob/main/totalspineseg/inference.py#L265-L281

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants