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

Home » Public Forums » archive » Re: Variable is undefined: Actually a function
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Variable is undefined: Actually a function [message #76809] Thu, 07 July 2011 12:44 Go to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 7/7/11 1:32 PM, Maegereg wrote:
> Michael Galloy wrote:
>> So PHYSIOLOGY::MTT has a "compile_opt strictarr"? Could we see
>> PHYSIOLOGY::MTT?
>>
>> Mike
>
> function Physiology::MTT, realCO=realCO, brainRatio=brainRatio,
> liverRatio=liverRatio, kidneyRatio=kidneyRatio, slowRatio=slowRatio
> compile_opt strictarr
> Forward_Function CALCULATE_DECAY_RATE
> if(N_Elements(realCO) EQ 0) then realCO=self.CO
> standardBV=5000.0d0
> standardCO=6500.0d0
> heartBV=(800.0+100.0)/standardBV*self.BV
> heartMTT=heartBV/realCO
> brainBV=(80.0+20.0+37.0+63.0)/standardBV*self.BV; plus a little more 40.0d0
> if(N_Elements(brainRatio) EQ 0) then brainRatio=975.0d0/standardCO
> brainBF=realCO*brainRatio
> brainMTT=brainBV/brainBF
> aortaBV=(800.0+200.0)/standardBV*self.BV
> aortaBF=(4810.0/standardCO)*realCO
> aortaMTT=aortaBV/aortaBF
> liverBV=(120.0d0+42.5)/standardBV*self.BV
> if(N_Elements(liverRatio) EQ 0) then liverRatio=1885.0d0/standardCO
> liverBF=liverRatio*realCO
> liverMTT=liverBV/liverBF
>
> aorta2BV=(400.0d0)/standardBV*self.BV assumed number
> aorta2BF=(2935.0/standardCO)*realCO
> aorta2MTT=aorta2BV/aorta2BF
>
> kidneyBV=(120.0d0+54)/standardBV*self.BV
> if(N_Elements(kidneyRatio) EQ 0) then kidneyRatio=1430.0d0/standardCO
> kidneyBF=kidneyRatio*realCO
> kidneyMTT=kidneyBV/kidneyBF
>
> slowBV=2200.0d0/standardBV*self.BV
> if(N_Elements(slowRatio) EQ 0) then slowRatio=1820.0d0/standardCO
> slowBF=slowRatio*realCO
> slowMTT=slowBV/slowBF
> slowRate=CALCULATE_DECAY_RATE(slowBF*0.55d0, self.Vf, self.Vs, slowMTT)
>
> return, [slowRate, (heartMTT+brainMTT), heartMTT+aortaMTT+aorta2MTT,
> kidneyMTT]
> end

This is a wild guess, but something you should check: is the filename
calculate_decay_rate.pro actually all lowercase? You had mentioned
Physiology__Define.pro (with initial caps), so I'm wondering. By the
way, it is good practice to make all .pro filenames completely
lowercase, there are strange problems not unlike this that can arise.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
Re: Variable is undefined: Actually a function [message #76810 is a reply to message #76809] Thu, 07 July 2011 12:32 Go to previous messageGo to next message
Maegereg is currently offline  Maegereg
Messages: 10
Registered: June 2011
Junior Member
Michael Galloy wrote:
> So PHYSIOLOGY::MTT has a "compile_opt strictarr"? Could we see
> PHYSIOLOGY::MTT?
>
> Mike

function Physiology::MTT, realCO=realCO, brainRatio=brainRatio,
liverRatio=liverRatio, kidneyRatio=kidneyRatio, slowRatio=slowRatio
compile_opt strictarr
Forward_Function CALCULATE_DECAY_RATE
if(N_Elements(realCO) EQ 0) then realCO=self.CO
standardBV=5000.0d0
standardCO=6500.0d0
heartBV=(800.0+100.0)/standardBV*self.BV
heartMTT=heartBV/realCO
brainBV=(80.0+20.0+37.0+63.0)/standardBV*self.BV; plus a little more 40.0d0
if(N_Elements(brainRatio) EQ 0) then brainRatio=975.0d0/standardCO
brainBF=realCO*brainRatio
brainMTT=brainBV/brainBF
aortaBV=(800.0+200.0)/standardBV*self.BV
aortaBF=(4810.0/standardCO)*realCO
aortaMTT=aortaBV/aortaBF
liverBV=(120.0d0+42.5)/standardBV*self.BV
if(N_Elements(liverRatio) EQ 0) then liverRatio=1885.0d0/standardCO
liverBF=liverRatio*realCO
liverMTT=liverBV/liverBF

aorta2BV=(400.0d0)/standardBV*self.BV assumed number
aorta2BF=(2935.0/standardCO)*realCO
aorta2MTT=aorta2BV/aorta2BF

kidneyBV=(120.0d0+54)/standardBV*self.BV
if(N_Elements(kidneyRatio) EQ 0) then kidneyRatio=1430.0d0/standardCO
kidneyBF=kidneyRatio*realCO
kidneyMTT=kidneyBV/kidneyBF

slowBV=2200.0d0/standardBV*self.BV
if(N_Elements(slowRatio) EQ 0) then slowRatio=1820.0d0/standardCO
slowBF=slowRatio*realCO
slowMTT=slowBV/slowBF
slowRate=CALCULATE_DECAY_RATE(slowBF*0.55d0, self.Vf, self.Vs, slowMTT)

return, [slowRate, (heartMTT+brainMTT), heartMTT+aortaMTT+aorta2MTT,
kidneyMTT]
end
Re: Variable is undefined: Actually a function [message #76813 is a reply to message #76810] Thu, 07 July 2011 08:52 Go to previous messageGo to next message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
On 7/7/11 9:41 AM, Maegereg wrote:
> David Fanning wrote:
>> Maegereg writes:
>>
>>> ...
>> I don't have time to investigate right now, but I think I ran
>> into a problem this week compiling a function that had a
>> hyphen in a directory in its path. I notice your
>> path has a hyphen, too. You could try putting this
>> program in a directory on your IDL path that didn't have
>> a hyphen in its name and see if that fixes the problem.
>>
>> Cheers,
>>
>> David
>>
> The function's already got a compile_opt strictarr, and removing the
> hyphen doesn't seem to help. The folder with the hyphen is the main
> project directory, so I doubt it would have much effect

So PHYSIOLOGY::MTT has a "compile_opt strictarr"? Could we see
PHYSIOLOGY::MTT?

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
Re: Variable is undefined: Actually a function [message #76814 is a reply to message #76813] Thu, 07 July 2011 08:41 Go to previous messageGo to next message
Maegereg is currently offline  Maegereg
Messages: 10
Registered: June 2011
Junior Member
David Fanning wrote:
> Maegereg writes:
>
>> ...
> I don't have time to investigate right now, but I think I ran
> into a problem this week compiling a function that had a
> hyphen in a directory in its path. I notice your
> path has a hyphen, too. You could try putting this
> program in a directory on your IDL path that didn't have
> a hyphen in its name and see if that fixes the problem.
>
> Cheers,
>
> David
>
The function's already got a compile_opt strictarr, and removing the
hyphen doesn't seem to help. The folder with the hyphen is the main
project directory, so I doubt it would have much effect
Re: Variable is undefined: Actually a function [message #76819 is a reply to message #76814] Wed, 06 July 2011 20:15 Go to previous messageGo to next message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Maegereg writes:

>
> Still working on the same project as when I last posted an inquiry (the
> relevant detail would be that I did not write this code). I'm getting
> the following error at runtime:
>
> % Variable is undefined: CALCULATE_DECAY_RATE.
> % Execution halted at: PHYSIOLOGY::MTT
> % ESTIMATE_AIF_MRTM 283 ~/Developer/DCE-MRI
> ABC/MRTM/estimate_aif_mrtm.pro
> % ANALYZE_ROI_DATA_EVENT 582 ~/Developer/DCE-MRI
> ABC/ANALYSIS/analyze_roi_data.pro
> % WIDGET_PROCESS_EVENTS
> % $MAIN$
>
> I've checked through PHYSIOLOGY::MTT, and it does call the function
> CALCULATE DECAY RATE. The function is defined in
> calculate_decay_rate.pro, is the last function in that file, and the
> file is in ~/Developer/DCE-MRI ABC/OTHER_AIF/Bayesian, which is a
> subfolder of the project directory (~/Developer/DCE-MRI ABC/). I've also
> tried adding a forward function declaration to PHYSIOLOGY::MTT to no
> avail. As you might expect, manually compiling calculate_decay_rate.pro,
> and then manually compiling Physiology__Define.pro before running the
> project will make the error go away, but whenever I do a full build on
> the project the error returns. I've checked the project build order, and
> calculate_decay_rate.pro should be built before Physiology__Define.pro.
> Any help would be greatly appreciated.

I don't have time to investigate right now, but I think I ran
into a problem this week compiling a function that had a
hyphen in a directory in its path. I notice your
path has a hyphen, too. You could try putting this
program in a directory on your IDL path that didn't have
a hyphen in its name and see if that fixes the problem.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thue. ("Perhaps thos speakest truth.")
Re: Variable is undefined: Actually a function [message #76822 is a reply to message #76819] Wed, 06 July 2011 16:22 Go to previous messageGo to next message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
On Jul 6, 5:17 pm, Maegereg <maege...@uchicago.edu> wrote:
> Still working on the same project as when I last posted an inquiry (the
> relevant detail would be that I did not write this code). I'm getting
> the following error at runtime:
>
> % Variable is undefined: CALCULATE_DECAY_RATE.
> % Execution halted at: PHYSIOLOGY::MTT
> %                      ESTIMATE_AIF_MRTM  283 ~/Developer/DCE-MRI
> ABC/MRTM/estimate_aif_mrtm.pro
> %                      ANALYZE_ROI_DATA_EVENT  582 ~/Developer/DCE-MRI
> ABC/ANALYSIS/analyze_roi_data.pro
> %                      WIDGET_PROCESS_EVENTS
> %                      $MAIN$
>
> I've checked through PHYSIOLOGY::MTT, and it does call the function
> CALCULATE DECAY RATE. The function is defined in
> calculate_decay_rate.pro, is the last function in that file, and the
> file is in ~/Developer/DCE-MRI ABC/OTHER_AIF/Bayesian, which is a
> subfolder of the project directory (~/Developer/DCE-MRI ABC/). I've also
> tried adding a forward function declaration to PHYSIOLOGY::MTT to no
> avail. As you might expect, manually compiling calculate_decay_rate.pro,
> and then manually compiling Physiology__Define.pro before running the
> project will make the error go away, but whenever I do a full build on
> the project the error returns. I've checked the project build order, and
> calculate_decay_rate.pro should be built before Physiology__Define.pro.
> Any help would be greatly appreciated.

If ESTIMATE_AIF_MRTM makes no use of () for array indexing, a
'compile_opt strictarr' in it would solve the problem.
Re: Variable is undefined: Actually a function [message #76905 is a reply to message #76810] Thu, 07 July 2011 17:09 Go to previous message
penteado is currently offline  penteado
Messages: 866
Registered: February 2018
Senior Member
Administrator
Is the right file found with

print,file_which('calculate_decay_rate.pro')
print,file_which('calculate_decay_rate.pro',/include_current _dir)

?

Also, what happens if you do

resolve_routine,'calculate_decay_rate',/is_function

?

On Jul 7, 4:32 pm, Maegereg <maege...@uchicago.edu> wrote:
> function Physiology::MTT, realCO=realCO, brainRatio=brainRatio,
> liverRatio=liverRatio, kidneyRatio=kidneyRatio, slowRatio=slowRatio
> compile_opt strictarr
> Forward_Function CALCULATE_DECAY_RATE
> if(N_Elements(realCO) EQ 0) then realCO=self.CO
> standardBV=5000.0d0
> standardCO=6500.0d0
> heartBV=(800.0+100.0)/standardBV*self.BV
> heartMTT=heartBV/realCO
> brainBV=(80.0+20.0+37.0+63.0)/standardBV*self.BV; plus a little more 40.0d0
> if(N_Elements(brainRatio) EQ 0) then brainRatio=975.0d0/standardCO
> brainBF=realCO*brainRatio
> brainMTT=brainBV/brainBF
> aortaBV=(800.0+200.0)/standardBV*self.BV
> aortaBF=(4810.0/standardCO)*realCO
> aortaMTT=aortaBV/aortaBF
> liverBV=(120.0d0+42.5)/standardBV*self.BV
> if(N_Elements(liverRatio) EQ 0) then liverRatio=1885.0d0/standardCO
> liverBF=liverRatio*realCO
> liverMTT=liverBV/liverBF
>
> aorta2BV=(400.0d0)/standardBV*self.BV assumed number
> aorta2BF=(2935.0/standardCO)*realCO
> aorta2MTT=aorta2BV/aorta2BF
>
> kidneyBV=(120.0d0+54)/standardBV*self.BV
> if(N_Elements(kidneyRatio) EQ 0) then kidneyRatio=1430.0d0/standardCO
> kidneyBF=kidneyRatio*realCO
> kidneyMTT=kidneyBV/kidneyBF
>
> slowBV=2200.0d0/standardBV*self.BV
> if(N_Elements(slowRatio) EQ 0) then slowRatio=1820.0d0/standardCO
> slowBF=slowRatio*realCO
> slowMTT=slowBV/slowBF
> slowRate=CALCULATE_DECAY_RATE(slowBF*0.55d0, self.Vf, self.Vs, slowMTT)
>
> return, [slowRate, (heartMTT+brainMTT), heartMTT+aortaMTT+aorta2MTT,
> kidneyMTT]
> end
Re: Variable is undefined: Actually a function [message #76907 is a reply to message #76809] Thu, 07 July 2011 13:23 Go to previous message
Maegereg is currently offline  Maegereg
Messages: 10
Registered: June 2011
Junior Member
Michael Galloy wrote:
> This is a wild guess, but something you should check: is the filename
> calculate_decay_rate.pro actually all lowercase? You had mentioned
> Physiology__Define.pro (with initial caps), so I'm wondering. By the
> way, it is good practice to make all .pro filenames completely
> lowercase, there are strange problems not unlike this that can arise.
>
> Mike

Yep. I think I actually changed that at some point in an attempt to fix
the problem, and it didn't work.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: mgunit 1.2 release
Next Topic: TOTAL gives totally different result on identical array

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

Current Time: Wed Oct 08 13:49:03 PDT 2025

Total time taken to generate the page: 0.00704 seconds