comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Images
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Images [message #91960 is a reply to message #91955] Wed, 23 September 2015 08:06 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
On 09/22/15 18:42, Paulo Penteado wrote:
> On Tuesday, September 22, 2015 at 7:10:50 PM UTC-3, Joyrles Fernandes wrote:
>> I have many images of dimensions [512,512], 320 images.
>> I want to take a piece of each([1,512] and I want to join the
>> images'pieces in a only array, for example [320,512].
>
> The answer depends on what you mean by "having images". Are the
> imagesin files? One file per image? Guessing the answer to both questions is
> yes, and that you have an array with the 320 file names (let's call it
> filenames), one possible way might be something like
>
> compound_image=dblarr(320,512) ;guessing that your image data are doubles
> for i=0,319 do compound_image[i,*]=(read_image(filenames[i]))[1,*]

Or, if we assume the image data is in bytes:

image_stack = bytarr(512,512,320)
help, image_stack
IMAGE_STACK BYTE = Array[512, 512, 320]

for i = 0,319 do image_stack[*,*,i] = read_image(filenames[i])

That works out to < 100MB by my reckoning. And < 300MB if there are RGB
channels as well. Doesn't seem too large(?).

Then, also assuming the indexing order is correct, any slice required
can be selected:

slice_index = 6 ; pick the 6'th longitudinal slice
image_slice = transpose(image_stack[slice_index,*,*],[2,1,0])
help, image_slice
IMAGE_SLICE BYTE = Array[320, 512]

slice_index = 100 ; pick the 100'th transverse slice
image_slice = transpose(image_stack[*,slice_index,*],[2,0,1])
help, image_slice
IMAGE_SLICE BYTE = Array[320, 512]

cheers,

paulv
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Can't read responses to my comment!
Next Topic: Legend object without border

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Nov 28 09:26:35 PST 2025

Total time taken to generate the page: 0.01692 seconds