How to open NIFTI-GZ (.gz) files?

The exact name of the image is: IMAGE01.rgb.gz

I found a lot about nii.gz, but what the hell is .rgb.gz?

Hmm…

I haven’t seen such images yet. If you know that they are nifti images then try renaming them to .nii.gz and see if you can load them. If that fails then unzip them and have a look at it using an editor if the header looks familiar. If not then you can use RawImageGuess extension on the unzipped file to guess image parameters and load the file.

from my understanding, .gz is a compression by gunzip or gzip?
What would be the difference between gunzip and gzip?

Or .gz in this case means something else?

I managed to unzip them with Win rar… I have no clue what it unzipped, maybe that is now where i made the mistake…

When I “unzip them” I am left with an .rgb file extension.

.rgb file is some old format used in the 90s https://en.wikipedia.org/wiki/Silicon_Graphics_Image
by company Silicon Graphics and that company apparently went bankrupt after cold war ended since they ran out out government contracts.

Now I tried opening .rgb with a whole lot of software, non of them worked. They all say “cant read header, wrong file type”

so I dont know now where the mistake happened…

  1. what does .gz mean
  2. did it properly get extracted or it was some fault extraction by win rar
  3. is the problem with opening the .rgb simply problem of not having software to open it… I found the ones in the internet that said they can open it.

gz means compressed with gzip. Most probably winrar unzipped it correctly. If it is a scalar image (with a single component) then you should be able to load it using RawImageGuess module. If it is RGB, as the name suggests, then RawImageGuess would need to be tuned a bit to accept RGB voxels, too. There is similar raw image import feature in ImageJ (it supports RGB images, but not live image preview, so it is a bit harder to guess the right image dimensions).

Where the image comes from? Can you share a sample?

I’ll have to ask for a permission to share…I’ll do so tomorrow early morning…

But this isn’t a 3d image… this is a 2D image so those would be pixels, rather than voxels.

I wonder if there is some proper way to open the file and see what header in it says.

I am downloading ImageJ

that’s the trouble picking up some governmental research from cold war era… no computers, no compatible software, weird file formats hahaha

2D image should be no problem, as it is just a single-slice 3D volume.

HEre I tried to read it through some anayzer and it just gave me a bunch of random letters.

Also yes .RGB files are indeed rgb type and there is possibility of .RGBA which basically adds alpha to the format.

but the one I have is definitely without alpha

can you please tell me how can i look at the header using the “editor” as you’ve previously said… I assume in the header we can see how it looks like

Here I was given the same file type but not related to confidential research.

So we can exmine it: https://drive.google.com/open?id=1YfZWbj2MpUwDVt_Kt8q_83Z-PK-LEAwf

Interestingly SGI not only had those files but they had computer machines which run those files and as name implies Silicone Graphics was a company that worked with graphics. So hard to believe technology gets so old and obsolete so quickly.

Here is a wider description of what the file format looks like:
http://paulbourke.net/dataformats/sgirgb/sgiversion.html
Written by a creator of the file format. He also gives a lot of functions how to decompress the file, whatever that means. He basically gives like 5-6 functions but I have no clue in which program he wrote those and how to utilize those anyway. I am a noob

http://paulbourke.net/dataformats/sgirgb/
I have found here how header should look like

Also I have found this:
A straightforward C library that reads SGI RGB files: readrgb.h and readrgb.c and turns them into a 4 byte RGB and alpha channel.

hmm

The SGI file at the download link is very different (compressed and does not have the same range of values) from the one you showed above (which looks like uncompressed pixel buffer). Probably .rgb just means that it is an RGB color file and has nothing to do with SGI.

To load the file, you can either follow the recommendations that I gave above or share a single example file.

Just talked to my professor and he laughed at me…
He said the files “may be shared” for such reasons it is nothing confidential nor so strict, it’s just we don’t have a permission to share in a way redistribute data publicly for other reasons.

Sorry for my initial misunderstanding Lassoan. I am just too careful not to break some rules, since I know he made us sight that we won’t “redistribute” bla bla bla… But clearly he didn’t mean something silly like this.

But I just tried what you said and it worked… it’s raw RGB data and not .RGB format from silicone graphics. I IMPRTED (not opened) the file as RAW image in imageJ program and chose resolution because I read the description file about resolution and I just chose randomly 24bi 32 bit 8 bit until it looked okay.

Amazing Lassoan… Sorry I made it harder for you to help me because I didn’t know what the actual data policy of my university is like.

Either way you saved my life at least 3-4 times so far.

So to conclude…
.gz can be exported easily with win rar
.rgb must not be a file with header that Paul has developed for Silicone Graphics but INSTEAD raw RGB data. This data can be opened with imageJ IF you know the resolution and how many bits the image should be 24 bit or 8 bit or 32 bit.

Hope that helps anyone who reads this thread in the future.

So here as promised I post the file

1 Like