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

Home » Public Forums » archive » Calculate median of stacks of images using IDL
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: Calculate median of stacks of images using IDL [message #88709 is a reply to message #88707] Sun, 08 June 2014 12:06 Go to previous messageGo to previous message
Phillip Bitzer is currently offline  Phillip Bitzer
Messages: 223
Registered: June 2006
Senior Member
On Friday, June 6, 2014 3:46:37 PM UTC-5, Nitsorn Wongsajjathiti wrote:
> Hi,
>
> I am trying to compute a median of a stack of images in TIF format for my research. From another source I found out a way to compute this from stack of images present in a GDF format, using
>
>
>
> IDL> buf=read_gdf('demo.gdf')
>

So, I suppose READ_GDF is from another library, yes? Do you _need_ things in GDF?

If you have TIFFs, you can just use READ_TIFF, and create a 3d array like David suggests.

Depending on how many TIFFs you have, you may find this modification to David's snippet to be slightly more efficient:

filenames = file_search("my_filename_regex*.tif", COUNT=fileCount) ;get the filenames, and how many

isGood = QUERY_TIFF(filenames[0], tiffInfo) ;get information about the first TIFF file

;assuming the TIFFs are 8 bit....if 16bit you can change to UINTARR
buf = BYTARR([tiffInfo.resolution, fileCount]) ;assuming all TIFFs are the same size, preallocate the array

FOREACH f in filenames DO $
buf[0, 0, i] = READ_TIFF(f) ;read each TIFF into the buf array

b = median(buf, /double, dimension=3)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to use SPAWN for creating multiple output files?
Next Topic: IDLdoc 3.6.0 released

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

Current Time: Wed Oct 08 17:54:41 PDT 2025

Total time taken to generate the page: 0.00195 seconds