Uncompressing Tiff files created in Matlab

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

Uncompressing Tiff files created in Matlab

Robert Martin-3
Greetings List,

I have created a series of 3-D tiff matrices/images in Matlab and
ImageJ does not seem to be able to uncompress these series of images.  
Does anyone know of a way to uncompress these so that I can scroll
through them in ImageJ?  Alternately, does anyone know how to create
uncompressed tiffs in Matlab?


Thanks

Robert Martin
Reply | Threaded
Open this post in threaded view
|

Re: Uncompressing Tiff files created in Matlab

ctrueden
Hi Robert,

Did you try:
  * Bio-Formats -- http://www.loci.wisc.edu/ome/formats.html
  * the JIMI reader -- http://rsb.info.nih.gov/ij/plugins/jimi.html
  * the Image I/O reader --
http://ij-plugins.sourceforge.net/plugins/imageio/index.html

The ImageJ Documentation Wiki has a nice list of plugins for different
file formats:
http://imagejdocu.tudor.lu/imagej-documentation-wiki/faq/which-file-types-are-supported-by-imagej

If nothing works, and you would be willing to send a sample file, I
can investigate adding support to Bio-Formats.

-Curtis

On Dec 14, 2007 1:41 AM, Robert Edward Martin
<[hidden email]> wrote:

> Greetings List,
>
> I have created a series of 3-D tiff matrices/images in Matlab and
> ImageJ does not seem to be able to uncompress these series of images.
> Does anyone know of a way to uncompress these so that I can scroll
> through them in ImageJ?  Alternately, does anyone know how to create
> uncompressed tiffs in Matlab?
>
>
> Thanks
>
> Robert Martin
>
Reply | Threaded
Open this post in threaded view
|

Re: Uncompressing Tiff files created in Matlab

Serapio M. Baca
In reply to this post by Robert Martin-3
This should work to create an uncompressed tiff stack in MATLAB that  
can be opened up in ImageJ. Please check the MATLAB documentation with  
regard to how it handles the matrix with imwrite. If the matrix is not  
scaled properly in MATLAB you will get a useless .tiff stack when  
using imwrite.

% to get more information on additional options on the main function:
help imwrite

%to write your matlab matrix called "image_stack" of 200 frames of  
data to a 512 by 512,16-bit, uncompressed tiff file named  
"name_of_image_stack.tiff"

for i = 1:200
        imwrite(uint16(image_stack(:,:,i)),...
        'name_of_image_stack.tiff','tiff',...
        'Compression','none',...
        'WriteMode','append',...
        'Resolution',[512 512],...
        'Description','200 frames at 512 xres and 512 yres pixel resolution  
with no compression');
end

-smb


On Dec 14, 2007, at 2:41 AM, Robert Edward Martin wrote:

> Greetings List,
>
> I have created a series of 3-D tiff matrices/images in Matlab and
> ImageJ does not seem to be able to uncompress these series of images.
> Does anyone know of a way to uncompress these so that I can scroll
> through them in ImageJ?  Alternately, does anyone know how to create
> uncompressed tiffs in Matlab?
>
>
> Thanks
>
> Robert Martin
Reply | Threaded
Open this post in threaded view
|

Re: Uncompressing Tiff files created in Matlab

Marko Usaj
In reply to this post by ctrueden
Hi!

You can do uncompressed tiffs in Matlab with function

imwrite(A,filename,fmt).

All you have to do is to specify parameter/flag 'Compression' to 'none'. Default setting is with compression.

Example:

you have data A to store in file named mypicture.tiff as tiff file with no compression:

imwrite(A,'mypicture.tiff', 'tiff', 'Compression','none');

Hope it helps.

Marko

-----Original Message-----
From: ImageJ Interest Group on behalf of Curtis Rueden
Sent: pet 14.12.2007 15:38
To: [hidden email]
Subject: Re: Uncompressing Tiff files created in Matlab
 
Hi Robert,

Did you try:
  * Bio-Formats -- http://www.loci.wisc.edu/ome/formats.html
  * the JIMI reader -- http://rsb.info.nih.gov/ij/plugins/jimi.html
  * the Image I/O reader --
http://ij-plugins.sourceforge.net/plugins/imageio/index.html

The ImageJ Documentation Wiki has a nice list of plugins for different
file formats:
http://imagejdocu.tudor.lu/imagej-documentation-wiki/faq/which-file-types-are-supported-by-imagej

If nothing works, and you would be willing to send a sample file, I
can investigate adding support to Bio-Formats.

-Curtis

On Dec 14, 2007 1:41 AM, Robert Edward Martin
<[hidden email]> wrote:

> Greetings List,
>
> I have created a series of 3-D tiff matrices/images in Matlab and
> ImageJ does not seem to be able to uncompress these series of images.
> Does anyone know of a way to uncompress these so that I can scroll
> through them in ImageJ?  Alternately, does anyone know how to create
> uncompressed tiffs in Matlab?
>
>
> Thanks
>
> Robert Martin
>