#include "itkCommand.h"
#include "vvImage.h"
-class vvImageWriter {
+class vvImageWriter : public itk::LightObject {
public:
- // constructor
- vvImageWriter();
- ~vvImageWriter();
+ typedef vvImageWriter Self;
+ typedef itk::SmartPointer<Self> Pointer;
+ itkNewMacro(Self);
void SetOutputFileName(std::string filename);
void SetObserver(itk::Command::Pointer o) {
void Update(int dim, std::string OutputPixelType);
protected:
+ // constructor
+ vvImageWriter();
+ ~vvImageWriter();
+
//====================================================================
std::string mOutputFilename;
itk::Command::Pointer mObserver;
std::string action = "Saving";
vvProgressDialog progress("Saving "+fileName.toStdString());
qApp->processEvents();
- vvImageWriter *writer = new vvImageWriter;
+ vvImageWriter::Pointer writer = vvImageWriter::New();
writer->SetOutputFileName(fileName.toStdString());
writer->SetInput(mSlicerManagers[index]->GetImage());
writer->Update();