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

Jothybasu Selvaraj jothybasu at gmail.com
Wed Apr 4 09:37:21 EDT 2012


Why can't you create a separate class for the reader and use them anywhere
you like?

Jothy

On Wed, Apr 4, 2012 at 2:28 PM, Xiaopeng Yang <yxp233 at postech.ac.kr> wrote:

> I would like to use rescaler1 in another two different cxx files.
>
> -----Original Message-----
> From: alex Dowson [mailto:alexdowson at hotmail.com]
> Sent: Wednesday, April 04, 2012 10:25 PM
> To: Xiaopeng Yang; 'John Drescher'
> Cc: insight-users at itk.org
> Subject: Re: [Insight-users] How to define global ITK variable for
> differentcxx files
>
> Hi
>
> What exactly you trying to do with that ?
>
>
>
>
> -----Original Message-----
> From: Xiaopeng Yang
> Sent: Wednesday, April 04, 2012 6:52 PM
> To: 'John Drescher'
> Cc: insight-users at itk.org
> Subject: Re: [Insight-users] How to define global ITK variable for
> differentcxx files
>
> 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
>
>
>
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>
>
>
>
>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>



-- 
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20120404/a72bdf83/attachment.htm>


More information about the Insight-users mailing list