[Insight-developers] ClassifierBase::SetDecisionRule

Jisung Kim bahrahm at yahoo . com
Tue, 29 Jul 2003 09:45:10 -0700 (PDT)


Hi Jim.

I'm modifying it. Also, I am looking at other files
for the same thing. 

Thanks,

--- "Miller, James V (Research)" <millerjv at crd . ge . com>
wrote:
> I notice the Classifier code in ITK has methods like
> SetDecisionRule() that
> take as an argument a SmartPointer.
>  
> Shouldn't the argument be a raw pointer?  Using a
> raw pointer as an argument
> allows the casting up through the superclass chain. 
> You can still pass in a
> SmartPointer when the routine is called and it
> should be automatically
> converted to a raw pointer. Using a raw pointer as a
> parameter also avoids
> making unnecessary calls to Mutex locks etc.
>  
> With the exception of the New() method, I think ITK
> always takes raw pointer
> as parameters and returns raw pointers on access
> methods.  It is the
> responsibility of the method to stash parameters
> passed as raw pointers into
> SmartPointers if they need to be maintained past the
> lifetime of the method.
> It is the responsibility of the caller to stash
> return values into
> SmartPointer is they need a persistent handle to the
> object.  The exception
> to this rule is any method which allocates objects
> and returns them as
> return values.  In this case, the return type should
> be a SmartPointer in
> order to make sure the object persists long enough
> for the caller to stash
> the return value in another SmartPointer.
>  
> I haven't looked through the rest of the Statistics
> library.  There may be
> other cases of this.  We probably should align this
> library with the rest of
> the toolkit.
>  
> 
> Jim Miller 
> _____________________________________
> Visualization & Computer Vision
> GE Research
> Bldg. KW, Room C218B
> P.O. Box 8, Schenectady NY 12301
> 
> millerjv at research . ge . com
> <mailto:millerjv at research . ge . com> 
> 
> james . miller at research . ge . com
> (518) 387-4005, Dial Comm: 8*833-4005, 
> Cell: (518) 505-7065, Fax: (518) 387-6981 
> 
>  
> 


=====
Jisung Kim
bahrahm at yahoo . com
106 Mason Farm Rd.
129 Radiology Research Lab., CB# 7515
Univ. of North Carolina at Chapel Hill
Chapel Hill, NC 27599-7515

__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder . yahoo . com