[Insight-users] How to define global ITK variable for different cxx files

Xiaopeng Yang yxp233 at postech.ac.kr
Wed Apr 4 09:22:44 EDT 2012


I tried as follows. But I am not sure it is right or not.

// globals.h 
 
#ifndef GLOBALS_H 
#define GLOBALS_H 
 
#ifndef EXTERN 
#define EXTERN extern 
#endif 


#include <itkImage.h>

#include "itkRescaleIntensityImageFilter.h"

typedef    float    InputPixelType;

typedef itk::Image< InputPixelType,  3 >   InputImageType;

typedef itk::RescaleIntensityImageFilter< 
             InputImageType, InputImageType > RescaleFilterType;

EXTERN RescaleFilterType::Pointer rescaler1 = RescaleFilterType::

#endif

Thanks.

-----Original Message-----
From: John Drescher [mailto:drescherjm at gmail.com] 
Sent: Wednesday, April 04, 2012 10:03 PM
To: Xiaopeng Yang
Cc: insight-users at itk.org
Subject: Re: [Insight-users] How to define global ITK variable for different
cxx files

> Assume that I have two cxx files: a.cxx and b.cxx and two head files: 
> a.h and b.h.
>
>
>
> I would like to define a global itk reader in a and then use that 
> reader in b.
>
>
>
> How to achieve this?
>

Add a third header file defining the global.

John









More information about the Insight-users mailing list