Comments (7)
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.
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.
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.
Since this is merged, can we push a new version of the crate to crates.io, please?
from nifti-rs.
Indeed, a new version is due. I will work on it when I'm able.
from nifti-rs.
from nifti-rs.
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)
- Documentation Examples Do Not Compile HOT 2
- Inverse Linear Transform on writing HOT 5
- into_img_file_gz HOT 2
- Malformed header writing when `descrip` has a different size HOT 4
- Data writing is always done in native byte order regardless of header HOT 2
- Rethink some of the header's default attribute values HOT 3
- Huge gz file HOT 5
- Automatic extension HOT 2
- ndarray 0.13 HOT 2
- Shortcut for the 10 AsPrimitive<T> HOT 8
- Tracker issue towards 1.0 -- API stability HOT 9
- Writing 4D images with a single volume
- Header fix HOT 7
- FSL intent HOT 2
- Unused dimension 0 or 1 HOT 2
- support nifti-2 files HOT 3
- IncompatibleLength HOT 3
- IntoNdArray for slice views could be more efficient
- Resampling of the Image Volume HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nifti-rs.