[Insight-users] What is the connection between 'SetFileName' and
'itkSetStringMacro'?
daniel mark
danielmarkhot at gmail.com
Mon Oct 23 11:35:05 EDT 2006
Hello all:
I have the following code:
typedef itk::ImageFileReader< InputImageType > ReaderType;
ReaderType::Pointer reader = ReaderType::New();
reader->SetFileName( argv[1] );
#ifndef __itkImageFileReader_h
#define __itkImageFileReader_h
/** Specify the file to read. This is forwarded to the IO instance. */
itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
#endif // __itkImageFileReader_h
I try to find where the definition of SetFileName is.
Finally, I got this:
#define itkSetStringMacro(name) virtual void Set##name (const char*
_arg) { if ( _arg && (_arg == this->m_##name) ) { return;} if (_arg) {
this->m_##name = _arg; } else { this->m_##name = ""; }
this->Modified(); }
The above snippet is totally out of my mind.
Can anyone give me what is going on here?
or
Point me to some places where I can find related C++ syntax.
Thank you
-Daniel
More information about the Insight-users
mailing list