GithubHelp home page GithubHelp logo

Comments (7)

twitzelbos avatar twitzelbos commented on August 17, 2024 2

I made some progress, and I can successfully write and mostly read everything I want. A significant change I'm making is to remove safe_transmute in favor of bytemuck, which will simplify many things.

The reason is that safe_transmute and co. make use of custom traits to signal if something is safe to transmute. In Rust, you must own either the type or the trait to be allowed to implement a trait for a type, which keeps leading to dead ends. Bytemuck has sufficient adoption that many types implement its traits, getting us out of that hole.

from nifti-rs.

nilgoyette avatar nilgoyette commented on August 17, 2024 1

I confirm that no one else is doing it (afaik)

As you know, writing is already implemented for all standard Rust types. + RGB. This leads to code duplication which I really don't like. One of our goals was to merge write_nifti and write_rgb_nifti in order to have a single write_nifti function. As always, we forgot about it :)

I would prefer not having a write_complex_nifti function alongside two other writing functions, but I understand that playing with traits in Rust is much more complex and constrained than in C++. This being said, maybe it's super simple, maybe you simply need to add Complex to DataElement, I haven't checked.

from nifti-rs.

nilgoyette avatar nilgoyette commented on August 17, 2024 1

I wrote about RGB because I don't like the current design, but you don't have to "fix" anything. If your goal is to handle complex number, you're free to do only that :)

from nifti-rs.

twitzelbos avatar twitzelbos commented on August 17, 2024 1

Since this is merged, can we push a new version of the crate to crates.io, please?

from nifti-rs.

Enet4 avatar Enet4 commented on August 17, 2024 1

Indeed, a new version is due. I will work on it when I'm able.

from nifti-rs.

Enet4 avatar Enet4 commented on August 17, 2024 1

Done!

from nifti-rs.

twitzelbos avatar twitzelbos commented on August 17, 2024

Okay, to summarize:

  • create a patch that adds the ability to write complex valued and RGB data to write_nifti
  • make sure reading works the same

If that sounds good, please assign the issue to me.

from nifti-rs.

Related Issues (20)

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.