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 #88455 is a reply to message #88449] Mon, 28 April 2014 19:04 Go to previous message
mikejohnryan08 is currently offline  mikejohnryan08
Messages: 5
Registered: April 2014
Junior Member
On Sunday, April 27, 2014 9:20:16 PM UTC-4, Mike Galloy wrote:
> 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

Thanks, that makes much more sense now. I was confused about where the self.color was coming from but now I understand. This is very helpful advice for kickstarting my research project, I certainly appreciate it.
[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: Sat Nov 29 16:25:44 PST 2025

Total time taken to generate the page: 1.44655 seconds