nifti_io.jar bug opening *.gz files?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

nifti_io.jar bug opening *.gz files?

pixelhead
Hi -

I'm using the latest nifti_io.jar (2009/12/05) from the plugin download section and am getting errors opening *.nii.gz or *.hdr.gz and *.img.gz files on MacOSX 10.6.2 using ImageJ64 v1.43r:
"File is not in a supported format, a reader plugin is not available, or it was not found."

Opening uncompressed files works fine. I'm using the sample datasets from the NifTI website:
http://nifti.nimh.nih.gov/nifti-1/data

I took a brief look at the Nifti_Reader.java source code and it seems a zip archive format is never specified (ie: fi.fileFormat = FileInfo.ZIP_ARCHIVE) when *.gz files are specified. Could this be the source of the problem?

Thanks,
Daren


Reply | Threaded
Open this post in threaded view
|

Re: nifti_io.jar bug opening *.gz files?

pixelhead
In case anyone has the same issue, I got nii.gz files to load by adding the extensions to the HandleExtraFileTypes.java and nifti_io.jar magically takes care of the rest. :)

Replace:
                // NIFTI format (.nii) handler
                if (name.endsWith(".nii")) {
                        return tryPlugIn("Nifti_Reader", path);
                }  
with
                if (name.endsWith(".nii") ||
                        name.endsWith( ".nii.gz" ) || name.endsWith( ".nii.z" ) )
                {
                        return tryPlugIn("Nifti_Reader", path);
                }  

Reply | Threaded
Open this post in threaded view
|

Re: nifti_io.jar bug opening *.gz files?

dscho
Hi,

On Wed, 5 May 2010, pixelhead wrote:

> In case anyone has the same issue, I got nii.gz files to load by adding
> the extensions to the HandleExtraFileTypes.java and nifti_io.jar
> magically takes care of the rest. :)
>
> Replace:
> // NIFTI format (.nii) handler
> if (name.endsWith(".nii")) {
> return tryPlugIn("Nifti_Reader", path);
> }  
> with
> if (name.endsWith(".nii") ||
> name.endsWith( ".nii.gz" ) || name.endsWith( ".nii.z" ) )
> {
> return tryPlugIn("Nifti_Reader", path);
> }  

Thanks:
http://pacific.mpi-cbg.de/cgi-bin/gitweb.cgi?p=fiji.git;a=commitdiff;h=f8959fa94f7c8ffe0e3f431a1c1f8a657557b6aa;hb=refs/heads/master

Ciao,
Johannes