cabeen / niftijio Goto Github PK
View Code? Open in Web Editor NEWA Java library for reading and writing NIfTI volumes
License: MIT License
A Java library for reading and writing NIfTI volumes
License: MIT License
Hi @cabeen
I hope you are well, I got an error when I wanted to read a nifti file that had a .json extension. It may be my misunderstanding of the format.
while (start_addr < (int) ds.vox_offset)
{
int[] size_code = new int[2];
size_code[0] = di.readInt();
size_code[1] = di.readInt();
int nb = size_code[0] - NiftiHeader.EXT_KEY_SIZE;
byte[] eblob = new byte[nb];
di.readFully(eblob, 0, nb);
ds.extension_blobs.add(eblob);
ds.extensions_list.add(size_code);
start_addr += (size_code[0]);
if (start_addr > (int) ds.vox_offset)
throw new IOException("Error: Data for extension " + (ds.extensions_list.size())
+ " appears to overrun start of image data.");
}
let's assume we have a JSON file (157 bytes) and 8 bytes for extension keys; when it reaches to end; the start_addr is 509, so It starts again and reads the first 8 bytes which may be wrong.
I think if it checks the size of the rest bytes, it could be solved. like this:
if(((int) ds.vox_offset - start_addr)<16)
break;
Kind regards,
Hi,
I was wondering if the niftijio could support nifti-2 or not?
Best,
Hi,
thank you very much for such a great library.
I want to use the dimension 5, 6, and 7. I understand it is not possible with this lib.
could I fork your repo and develop?
best,
Thanks for the great software!
Hi, I created a much improved version (in terms of efficiency) that uses a 1-d array (instead of 4-d) to store the data. Let me know if you want me to send it to you.
Jeremy
Hi Cabeen,
As already mentioned I think your library is very useful for the java medical imaging community.
It would be great if it could be published to Maven central, then we could simply add a dependency instead of having to clone to produce your own jar.
This would make it easily accessible to a wider audience. What do you think ?
Best,
Ghazi
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.