Re: .dat file size [message #39740] |
Wed, 09 June 2004 11:57 |
siliconcube
Messages: 11 Registered: June 2004
|
Junior Member |
|
|
Wow, thank you all very much for such quick and thorough replies, I
really apreciate it. I will try to help out to the rest of the board
with whatever little knoweldge I have of this program =).
thank you
Aleks
PS. Dr. Fanning, great book, great examples (publish more on image
processing =)
Aleks
Ben Tupper <btupper@bigelow.org> wrote in message news:<2iog3lFp4iu4U1@uni-berlin.de>...
> Aleks wrote:
>
>>
>> this is the part of the code i don't quiet understand
>>
>> volume = BytArr(80,100,50)
>> FOR j=0,49 DO BEGIN
>>
>> I know the 50 comes from the fact that there are 50 different images
>> so we are going to stack them(I have 81 in my own test project). Now
>> the 80 and a 100 comes from some other place and I know that is the
>> size of the array ie its a 80x100 array. I have a test_01.tif file how
>> would I figure out the size of the array?
>
> Hello,
>
> I think you are asking how to determine the size of the image in the
> tiff file(s). You can use the QUERY_**** routines to get basic
> information regarding the image before you read it into an IDL variable.
>
> Something like this should work if your slices are stored in separate
> files (you can easily modify this for multi-tiff format.)
>
>
> nImages = n_elements(file)
>
> ok = QUERY_TIFF(file[0], info)
>
> If ok Then Begin
>
> volume = BytArr([info.dimensions, nImages], /noZero)
>
> for i = 0, nimages-1 Do $
> Volume[*,*,i] = READ_IMAGE(file[i])
>
> EndIf
>
>
>
> Ben
|
|
|
Re: .dat file size [message #39757 is a reply to message #39740] |
Wed, 09 June 2004 06:04  |
btt
Messages: 345 Registered: December 2000
|
Senior Member |
|
|
Aleks wrote:
>
> this is the part of the code i don't quiet understand
>
> volume = BytArr(80,100,50)
> FOR j=0,49 DO BEGIN
>
> I know the 50 comes from the fact that there are 50 different images
> so we are going to stack them(I have 81 in my own test project). Now
> the 80 and a 100 comes from some other place and I know that is the
> size of the array ie its a 80x100 array. I have a test_01.tif file how
> would I figure out the size of the array?
Hello,
I think you are asking how to determine the size of the image in the
tiff file(s). You can use the QUERY_**** routines to get basic
information regarding the image before you read it into an IDL variable.
Something like this should work if your slices are stored in separate
files (you can easily modify this for multi-tiff format.)
nImages = n_elements(file)
ok = QUERY_TIFF(file[0], info)
If ok Then Begin
volume = BytArr([info.dimensions, nImages], /noZero)
for i = 0, nimages-1 Do $
Volume[*,*,i] = READ_IMAGE(file[i])
EndIf
Ben
|
|
|
Re: .dat file size [message #39758 is a reply to message #39757] |
Wed, 09 June 2004 05:52  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Aleks writes:
> I'm very new to IDL. I was on Mr. Fanning's website and trying to
> figure out the code. This is the website for 3D imaging (exactly what
> I'm required to do)
> http://www.dfanning.com/graphics_tips/mesh.html
>
> this is the part of the code i don't quiet understand
>
> volume = BytArr(80,100,50)
> FOR j=0,49 DO BEGIN
>
> I know the 50 comes from the fact that there are 50 different images
> so we are going to stack them(I have 81 in my own test project). Now
> the 80 and a 100 comes from some other place and I know that is the
> size of the array ie its a 80x100 array. I have a test_01.tif file how
> would I figure out the size of the array? I have winXP and I have
> been battling this for nearly 3 hours (and i know this isn't even the
> IDL problem =/)
Oh, dear. There are several ways to figure out the size
of a TIFF file. Without reading it, you can use the QUERY_TIFF
function to find out:
IDL> ok = Query_Tiff('test_01.tif', info)
IDL> Print, info.dimensions
375 150
Or, you can just read one of the files and use the
SIZE function to get the dimensions:
IDL> image = Read_TIFF('test_01.tif')
IDL> Print, Size(image, /Dimensions)
375 150
(Assuming the file was 375 by 150. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|
Re: .dat file size [message #39760 is a reply to message #39758] |
Wed, 09 June 2004 02:14  |
mwvogel
Messages: 9 Registered: February 2003
|
Junior Member |
|
|
My 2 cents (the site documentation on this code is pretty clear IMHO) :
; first a few comments
volume = BytArr(80,100,50) ; make 3D volume of images with
dimension 80x100 pixels, of type BYTE
FOR j=0,49 DO BEGIN ; do for each 'layer'
image = Read_Tiff(sortedFiles[j]) ; read the image :-)
volume[0, 0, j] = image ; store image at 'layer'
indexed with j, note that this is a trick, as explained on the site
ENDFOR
Now for a set of 132 images (all identical in size !, and of type BYTE) with
have dimensions 123 x 231, you would do
volume = BytArr(123,231,132) ; make 3D volume of images with
dimension 123x231 pixels
FOR j=0,131 DO BEGIN ;
image = Read_Tiff(sortedFiles[j]) ;
volume[0, 0, j] = image ;
ENDFOR
Now to ease your search for the right dimensions, you could do
HELP, Read_Tiff(sortedFiles[0]) ; shows [X,Y] dimensions of image
You did ask for something like this, right ?
"Aleks" <siliconcube@yahoo.com> schreef in bericht
news:79140897.0406082205.78b69476@posting.google.com...
> Hi,
> I'm very new to IDL. I was on Mr. Fanning's website and trying to
> figure out the code. This is the website for 3D imaging (exactly what
> I'm required to do)
> http://www.dfanning.com/graphics_tips/mesh.html
>
> this is the part of the code i don't quiet understand
>
> volume = BytArr(80,100,50)
> FOR j=0,49 DO BEGIN
>
> I know the 50 comes from the fact that there are 50 different images
> so we are going to stack them(I have 81 in my own test project). Now
> the 80 and a 100 comes from some other place and I know that is the
> size of the array ie its a 80x100 array. I have a test_01.tif file how
> would I figure out the size of the array? I have winXP and I have
> been battling this for nearly 3 hours (and i know this isn't even the
> IDL problem =/) Any help would be apreciated.
|
|
|