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

Home » Public Forums » archive » Running this MATLAB code in 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: Running this MATLAB code in IDL [message #88449 is a reply to message #88448] Sun, 27 April 2014 18:20 Go to previous messageGo to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 4/27/14, 7:00 pm, mikejohnryan08@gmail.com wrote:
> Thanks for the responses! I agree that it would not be a good idea
> to attempt using the MATLAB code in any way towards thesis research,
> and that it would be better to write my own simple IDL function to do
> this.
>
> Mike, thanks for pointing me towards your code library. The
> "combineImages" method from your anaglyph class seems to be EXACTLY
> what I am trying to implement in IDL, and seems like it would be a
> very basic function; since as you said, I already have the left and
> right images. But since I am completely new to IDL, I can't even
> begin to think about how that method could be turned into a
> standalone function. It should be very basic, right?

Methods have access to the instance variables of the object and can call
other methods of the object using the "self" variable, so watch out for
them. In the _combineImages example, there was only the self.color
variable, so how about something like:

function mg_create_anaglyph, leftImage, rightImage, color=color
compile_opt strictarr

; define combined_image to the correct size
combinedImage = leftImage * 0B
dims = size(leftImage, /dimensions)

if (keyword_set(color)) then begin
combinedImage[0, *, *] = leftImage[0, *, *]
combinedImage[1, *, *] = rightImage[1, *, *]
combinedImage[2, *, *] = rightImage[2, *, *]
endif else begin
_leftImage = byte(total(fix(leftImage), 1) / 3)
_rightRight = byte(total(fix(rightImage), 1) / 3)

combinedImage[0, 0, 0] = Reform(_leftImage, 1, dims[1], dims[2])
combinedImage[1, 0, 0] = Reform(_rightRight, 1, dims[1], dims[2])
combinedImage[2, 0, 0] = Reform(_rightRight, 1, dims[1], dims[2])
endelse

return, combinedImage
end

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL: A Guide to IDL Programming (http://modernidl.idldev.com)
Research Mathematician
Tech-X Corporation
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: FFT and Parseval
Next Topic: Smooth and /EDGE_TRUNCATE

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

Current Time: Sun Oct 12 17:27:09 PDT 2025

Total time taken to generate the page: 1.68546 seconds