In brief, I have 12,000 512X512 individual and uncompressed 16-bit
tiffs. For a program that I am using, I need to make these into a
large tiff stack. I have been using the imread function with 'append'
to write them into the file, and it goes ok until about frame 9000,
but in the end I keep getting java memory heap errors.
I have tried changing the java.opts files as instructed but it still
seems to hang around 4.89GB. Both systems are 64-bit with 64 bit OS
(OS 10.6.3 or 64-bit XP). The XP machine has 32GB of RAM and the OS X
machine has 4GB but I get similar errors on both machines.
I was wondering if anyone else has experience with these sorts of
large image stacks that might suggest a possible solution? I fear it
is with the Java side as even ImageJ seems to mess up the individual
images to stack option. Right now, I am trying to do the appending in
small 500-1000 frame segments and then doing a clear/pack on the
terminal line before continuing, but there must be a better way.
Basically, the code looks like this:
%% for frames 1-10 - original stack starts at 0 so that is the reason
for the step offset
clear
step = 0;
for i = 1:10
temp_image = imread(['img ' int2str(step) '.tif']);
imwrite(temp_image, 'matlab_created_stack.tif', 'tif',
'WriteMode', 'append', 'Compression', 'none');
i
step = step+1;
end
clear
And help would be appreciated.
-smb
|
|
0
|
|
|
|
Reply
|
smbaca (4)
|
4/8/2010 4:16:03 PM |
|
On Apr 8, 6:16=A0pm, smb <smb...@gmail.com> wrote:
> In brief, I have 12,000 512X512 individual and uncompressed 16-bit
> tiffs. For a program that I am using, I need to make these into a
> large tiff stack. I have been using the imread function with 'append'
> to write them into the file, and it goes ok until about frame 9000,
> but in the end I keep getting java memory heap errors.
>
> I have tried changing the java.opts files as instructed but it still
> seems to hang around 4.89GB. Both systems are 64-bit with 64 bit OS
> (OS 10.6.3 or 64-bit XP). The XP machine has 32GB of RAM and the OS X
> machine has 4GB but I get similar errors on both machines.
>
> I was wondering if anyone else has experience with these sorts of
> large image stacks that might suggest a possible solution? I fear it
> is with the Java side as even ImageJ seems to mess up the individual
> images to stack option. Right now, I am trying to do the appending in
> small 500-1000 frame segments and then doing a clear/pack on the
> terminal line before continuing, but there must be a better way.
>
> Basically, the code looks like this:
>
> %% for frames 1-10 - original stack starts at 0 so that is the reason
> for the step offset
> clear
> step =3D 0;
> for i =3D 1:10
> =A0 =A0 temp_image =3D imread(['img =A0 =A0' int2str(step) '.tif']);
> =A0 =A0 imwrite(temp_image, 'matlab_created_stack.tif', 'tif',
> 'WriteMode', 'append', 'Compression', 'none');
> =A0 =A0 i
> step =3D step+1;
> end
> clear
>
> And help would be appreciated.
>
> -smb
a hint:
- look at the new tiff library wrapper
help tiff;
us
|
|
0
|
|
|
|
Reply
|
us
|
4/8/2010 4:20:26 PM
|
|
smb wrote:
> In brief, I have 12,000 512X512 individual and uncompressed 16-bit
> tiffs. For a program that I am using, I need to make these into a
> large tiff stack. I have been using the imread function with 'append'
> to write them into the file, and it goes ok until about frame 9000,
> but in the end I keep getting java memory heap errors.
>
> I have tried changing the java.opts files as instructed but it still
> seems to hang around 4.89GB. Both systems are 64-bit with 64 bit OS
> (OS 10.6.3 or 64-bit XP). The XP machine has 32GB of RAM and the OS X
> machine has 4GB but I get similar errors on both machines.
>
> I was wondering if anyone else has experience with these sorts of
> large image stacks that might suggest a possible solution? I fear it
> is with the Java side as even ImageJ seems to mess up the individual
> images to stack option. Right now, I am trying to do the appending in
> small 500-1000 frame segments and then doing a clear/pack on the
> terminal line before continuing, but there must be a better way.
>
> Basically, the code looks like this:
>
> %% for frames 1-10 - original stack starts at 0 so that is the reason
> for the step offset
> clear
> step = 0;
> for i = 1:10
> temp_image = imread(['img ' int2str(step) '.tif']);
> imwrite(temp_image, 'matlab_created_stack.tif', 'tif',
> 'WriteMode', 'append', 'Compression', 'none');
> i
> step = step+1;
> end
> clear
>
> And help would be appreciated.
>
> -smb
That's too much data for a TIFF file. The TIFF format uses 32-bit offsets.
>> log2(12000 * 512 * 512 * 2)
ans =
32.5507
---
Steve Eddins
http://blogs.mathworks.com/steve/
|
|
0
|
|
|
|
Reply
|
Steve
|
4/9/2010 11:51:34 AM
|
|
|
2 Replies
371 Views
(page loaded in 0.056 seconds)
Similiar Articles: Problems dealing with large tiff stack - comp.soft-sys.matlab ...In brief, I have 12,000 512X512 individual and uncompressed 16-bit tiffs. For a program that I am using, I need to make these into a large tiff stack. KNN classifier? - comp.soft-sys.matlab... comp.dcom.net-management ..... classifier code - comp.soft-sys.matlab help in creating classifier code - comp.soft-sys.matlab Problems dealing with large tiff stack ... VBOs for very large point sets? - comp.graphics.api.opengl ...large (page size) PDF problems - comp.text.pdf Problems dealing with large tiff stack - comp.soft-sys.matlab ... VBOs for very large point sets? - comp.graphics.api.opengl ... help in creating classifier code - comp.soft-sys.matlabProblems dealing with large tiff stack - comp.soft-sys.matlab ... mrtg.cfg problem with snmpv3 support - comp.dcom.net-management ... help in creating classifier code ... Quick Question re VMware - comp.os.cpmMp big deal if it doesn't ... The stack size in older operating systems may not >> be large enough in some cases. I haven't noticed any problems >> yet though ... Switch + Case - comp.lang.asm.x86... to use function because it has to push EIP into stack ... There are many ways to solve the problems so CPU can be ... Usually this isn't a big deal. You write your code in a ... Allocatable versus automatic arrays - comp.lang.fortranI had problems once on an Alpha system with ... compile time what size array it is dealing ... If you were using very large automatic arrays and hitting a stack size limit ... max length of * format write - comp.lang.fortran... tried this with v9.5, but in v8.6 I have no problems ... Might not work if the size of "a" is too big for some ... Ask the "write" EXIF question and Tiff tags - comp.soft ... improve strlen - comp.lang.asm.x86It has no stack frame and conforms to the normal ... Before you get in a tiff, I *do* realize that *you ... MMX was a big deal with a P200 mmx processor but it does ... Using thread-specific data in shared libraries - comp.programming ...Any potential problems > due to the unspecified ... should create new TSDs arrays (e.g. when their stack ... writing POSIX code anyway, I guess this isn't a big deal. Problems dealing with large tiff stack - comp.soft-sys.matlab ...In brief, I have 12,000 512X512 individual and uncompressed 16-bit tiffs. For a program that I am using, I need to make these into a large tiff stack. Tagged Image File Format - Wikipedia, the free encyclopediaTIFF (originally standing for Tagged Image File Format) is a file ... To avoid these problems, every TIFF reader was required to ... byte ordering", circa 1980) and "MM" for big ... 7/24/2012 4:06:06 PM
|