Code Monkey home page Code Monkey logo

Comments (7)

zapaishchykova avatar zapaishchykova commented on September 24, 2024

Hi Deepa!
Thanks for your suggestion! I was not able to quickly find a way to directly save nii files. I see the script you attached also uses an intermediate file "-label.nrrd". Do you know if there is a way to directly save niftys?

from segmentationreview.

deepakri201 avatar deepakri201 commented on September 24, 2024

Hi Anna,

So I believe that slicer.util.saveNode works for both nrrd and nii.gz, so instead of:
filepath = outputPath + "/" + referenceVolumeNode.GetName() + "-label.nrrd"
You can instead do:
filepath = outputPath + "/" + referenceVolumeNode.GetName() + "-label.nii.gz"

from segmentationreview.

zapaishchykova avatar zapaishchykova commented on September 24, 2024

Yeah so that does not work, I have tried it awhile ago and just now, here is the log:
[Python] Failed to save node to file
[Python] Error: No writer found to write file .nii.gz of type SegmentationFile.

from segmentationreview.

vprudente avatar vprudente commented on September 24, 2024

Is there a functional reason why you convert the nrrd/save the nifti? Why not just save the segmentations as .seg.nrrd? I can think of a few benefits of using .seg.nrrd instead of nifti, such as preserving header/metadata, segmentation color

from segmentationreview.

zapaishchykova avatar zapaishchykova commented on September 24, 2024

Good point, the only reason I can think of is the consistency between input and output. Also, nifty also saves headers with metadata (not the color tho)

from segmentationreview.

vprudente avatar vprudente commented on September 24, 2024

The inputs can be .nrrd files too (with the new mappings feature). Personally, I think the extension would benefit from saving the segmentations as .seg.nrrd. If nothing else, saves the overhead of re-saving the segmentations as niftis.

from segmentationreview.

zapaishchykova avatar zapaishchykova commented on September 24, 2024

i have removed the t.seg.nrrd in the latest commit, saving only nifty files.

from segmentationreview.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.