-
Notifications
You must be signed in to change notification settings - Fork 43
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
NIfTI C library is outdated with broken byte swapping within newer GCC #5
Comments
Hi @schuhschuh , do you know if this issue is fixed in IRTK 2.0? When trying out the new IRTK 2.0 through Python, I got:
and this messed up image header:
CMake says my system is little endian (Mac OSX if that's related), if I force the big endian flag, I get:
Bu if I remove the lines https://github.com/BioMedIA/IRTK/blob/master/Modules/Image/src/irtkFileNIFTIToImage.cc#L192 :
Then I get the correct header.
Now that IRTK 2.0 uses NiftiClib instead of shipping its own version of nifti reading code, I do not know if it still corresponds to the bug you reported but I'm curious to hear from your experience. |
Hi @kevin-keraudren, regarding the issue I reported here, it will not affect you with the new IRTK when on your system is a recent enough NiftiCLib installed (at least v1.1, better 2.0). Regarding the byte swapping issue within the IRTK code itself, I have had no issue so far with my private IRTK copy (no particular CMake refactoring). I suggest you report this issue and your findings in the issue tracker of the new IRTK so @ghisvail can have a closer look. Given that in the code you remove to "fix" the issue the The other issue you report seems that |
P.S.: I think the IRTK so far actually never defined EDIT: The image you are trying to read, was it written by an (old) IRTK tool? |
I am having trouble reading NIFTII files with this IRTK and I get an error like this: It seemed to me that it might related to this issue. The header is not read correctly, thus resulting in not finding the correct data type for the image? I included the NifTI 2.0 library but that did not fix. I am running on MacOS Sierra |
IRTK is deprecated in favour of MIRTK, which should include a more robust handling of NifTI I/O. |
The only problem is that I have a lot of legacy code written that depends on IRTK. |
Do you known on which platform your NifTI files have been generated from? Also can you successfully load them on This would tell us whether they are well formed, and which endianness they are potentially in. |
These were mostly generated under Windows 7. They successfully work when loaded on papaya. It is happening to pretty much every NifTI file I am trying to load with IRTK. |
So, big endian.
Confirming the files are well-formed.
Could you try running IRTK's FYI, I am looking for something obvious to fix. If the problem lies deeper in the code, then I will most likely not investigate further as IRTK is no longer actively maintained. Most of our software has been ported to MIRTK, which we actively maintain and support. |
@drkarim If you send a list of IRTK binaries that you are using, I can compile a brief overview of corresponding MIRTK commands or we'll see if one you need is missing. In case you mostly need As I see you're at King's, @ericspod has recently updated Eidolon to use MIRTK. |
@ghisvail The |
I suspect @drkarim is using IRTK as a library. Could you confirm @drkarim ? If that's the case, then porting the code to MIRTK might be a bit more involved. If you are just using the IRTK executables, please consider @schuhschuh's suggestion to port your process calls over to MIRTK Regardless, if this were a global endianness issue, the output of |
Never mind, I saw Andreas kick-started the portage. |
The NIfTI-1 C library source code included with the IRTK is outdated. I ran in particular into an issue that the byte swapping was not working when the library is compiled with optimization using GCC >=4.7. It turns out these problems have been fixed in the most recent 2.0 release version (this particular problem was possibly fixed in v1.1 from 2008 already).
https://gcc.gnu.org/ml/gcc-help/2015-04/msg00005.html
The text was updated successfully, but these errors were encountered: