comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Re: Reading 256x256x16bit images

Re: Reading 256x256x16bit images
type: item
description: Chris Penland <chris@erc-sparc.mc.duke.edu> wrote: > I have been using the following commands on IDL for PowerMac: > > openr, 1, 'silce214.dat' --->I assume you're correctly typing slice, not silce... > a=assoc(1,intarr(256,256)) > b=a(1) > > then I get an "Encountered end of file" error. If there's only one image in the file, You should say b=a(0). Remember, in IDL, an array A of length n has values A(0) thru A(n-1). > tv, b > > then I get something that looks nothing like my image. I have tried > using a bytarr(256,256) and I don;t run out of file but the > image looks like it has been checkerboarded and moved around. Since "b" is an integer array, to use "tv" you should first scale the values into a byte array using "BYTSCL". For example, h=bytscl(b) tv,h Or use "TVSCL" to do the same thing via: tvscl, b If you have multiple images and want them all displayed with the same scaling, use the keywords "max", "min", and "top" with BYTSCL. You should probably RTFM on ASSOC, BYTSCL, TV, and TVSCL. Hope that helps, -Jeff.
creator: jsbenens
date: 1996-06-16T07:00:00-00:00

Re: Reading 256x256x16bit images
type: item
description: Jason Young (jyoung@olie.wvitcoe.wvnet.edu) wrote: : This sounds like something I tried to do about a month ago. Except : mine were 512x512x12bit CT scan images. Of course the relative intensities : sould have been 0 to 4095 so the code looked like this: : a=intarr(512,512) : a=ishft(a,-4) : tvscl, a : This could create an image, but for some reason there was alot of : noise around where the bone should have been. I have tried many different : scaleing procedures that haven't helped. I also noticed that the data is : chopped because the upper value is 4080. This would probably be the cause : of the upper end noise since dence bone should be above 4080. I had to do : the shift because of IDL being 16 bit. Scaling by bit-shifting shouldn't make any difference, since tvscl does the scaling anyway. How big are the files? Is each 12-bit pixel stored in a 16-bit word on disk? Or are two 12-bit pixels stored in 3 8-bit bytes? If the latter, you'll have to do some fancy bit-twiddling to correctly load the image. Finally, are you sure you don't need to byteswap the data? Peter
creator: peter
date: 1996-06-19T07:00:00-00:00

Re: Reading 256x256x16bit images
type: item
description: This sounds like something I tried to do about a month ago. Except mine were 512x512x12bit CT scan images. Of course the relative intensities sould have been 0 to 4095 so the code looked like this: a=intarr(512,512) a=ishft(a,-4) tvscl, a This could create an image, but for some reason there was alot of noise around where the bone should have been. I have tried many different scaleing procedures that haven't helped. I also noticed that the data is chopped because the upper value is 4080. This would probably be the cause of the upper end noise since dence bone should be above 4080. I had to do the shift because of IDL being 16 bit. Jason Young EPSCoR Research Assistant Montgomery, WV 25136 phone: 304-442-1021 e-mail: jyoung@olie.wvitcoe.wvnet.edu http://www.wvitcoe.wvnet.edu/~jyoung
creator: jyoung
date: 1996-06-19T07:00:00-00:00