wxBitmap icon4(four_xpm);
wxBitmap icon5(five_xpm);
- if(index==1){ bbSetOutputIcon( icon1 );}
- if(index==2){ bbSetOutputIcon( icon2 );}
- if(index==3){ bbSetOutputIcon( icon3 );}
- if(index==4){ bbSetOutputIcon( icon4 );}
- if(index==5){ bbSetOutputIcon( icon5 );}
+ if(index==1){ bbSetOutputIcon( icon1 ); }
+ if(index==2){ bbSetOutputIcon( icon2 ); }
+ if(index==3){ bbSetOutputIcon( icon3 ); }
+ if(index==4){ bbSetOutputIcon( icon4 ); }
+ if(index==5){ bbSetOutputIcon( icon5 ); }
}
//=====
// Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
{
firsttime=false;
- ManualPaintModel *mpModel = new ManualPaintModel();
- mpModel->SetImage( bbGetInputIn() );
+ ManualPaintModel *mpModel = new ManualPaintModel();
+ mpModel->SetImages( bbGetInputIn() , bbGetInputIn2() );
- wxManualPaintPanel *mpPanel = (wxManualPaintPanel*)bbGetOutputWidget();
-printf("ManualPaint::Process 1\n");
+ wxManualPaintPanel *mpPanel = (wxManualPaintPanel*)bbGetOutputWidget();
mpPanel->SetManualPaintModel(mpModel);
-printf("ManualPaint::Process 2 %p\n", mpPanel);
if (bbGetInputWxVtkBaseView1()!=NULL)
{
ManualPaintControler *mpControler = new ManualPaintControler();
mpControler->SetManualPaintModel(mpModel);
-printf("ManualPaint::Process 3\n");
mpControler->SetManualPaintPanel(mpPanel);
-printf("ManualPaint::Process 4\n");
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView1() );
-printf("ManualPaint::Process 5 %p \n",bbGetInputWxVtkBaseView1() );
mpControler->Config();
-printf("ManualPaint::Process 6\n");
}
if (bbGetInputWxVtkBaseView2()!=NULL)
{
-printf("ManualPaint::Process 7\n");
ManualPaintControler *mpControler = new ManualPaintControler();
-printf("ManualPaint::Process 7.1\n");
mpControler->SetManualPaintModel(mpModel);
-printf("ManualPaint::Process 7.2\n");
mpControler->SetManualPaintPanel(mpPanel);
-printf("ManualPaint::Process 7.3\n");
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView2() );
-printf("ManualPaint::Process 7.4 %p\n", bbGetInputWxVtkBaseView2() );
mpControler->Config();
-printf("ManualPaint::Process 8\n");
}
if (bbGetInputWxVtkBaseView3()!=NULL)
{
-printf("ManualPaint::Process 9\n");
ManualPaintControler *mpControler = new ManualPaintControler();
mpControler->SetManualPaintModel(mpModel);
mpControler->SetManualPaintPanel(mpPanel);
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView3() );
mpControler->Config();
-printf("ManualPaint::Process 10\n");
}
if (bbGetInputWxVtkBaseView4()!=NULL)
{
-printf("ManualPaint::Process 11\n");
ManualPaintControler *mpControler = new ManualPaintControler();
mpControler->SetManualPaintModel(mpModel);
mpControler->SetManualPaintPanel(mpPanel);
mpControler->SetWxVtk2DBaseView( (wxVtk2DBaseView*)bbGetInputWxVtkBaseView4() );
mpControler->Config();
-printf("ManualPaint::Process 12\n");
}
-printf("ManualPaint::Process 13\n");
- }
-printf("ManualPaint::Process end\n");
+ } // firsttime
}
//=====
// Don't edit this file. This file is generated from xml description..
//=====
BBTK_DECLARE_INPUT(In,vtkImageData*);
+ BBTK_DECLARE_INPUT(In2,vtkImageData*);
BBTK_DECLARE_INPUT(WxVtkBaseView1,wxVtkBaseView*);
BBTK_DECLARE_INPUT(WxVtkBaseView2,wxVtkBaseView*);
BBTK_DECLARE_INPUT(WxVtkBaseView3,wxVtkBaseView*);
};
BBTK_BEGIN_DESCRIBE_BLACK_BOX(ManualPaint,bbtk::WxBlackBox);
-BBTK_NAME("ManualPaint");
-BBTK_AUTHOR("eduardo davila (Creatis)");
-BBTK_DESCRIPTION("Voxel manual paint");
-BBTK_CATEGORY("widget");
-BBTK_INPUT(ManualPaint,In,"Input image to be modified",vtkImageData*,"");
-BBTK_INPUT(ManualPaint,WxVtkBaseView1,"creaMaracasVisu viewer 2D",wxVtkBaseView*,"");
-BBTK_INPUT(ManualPaint,WxVtkBaseView2,"creaMaracasVisu viewer 2D",wxVtkBaseView*,"");
-BBTK_INPUT(ManualPaint,WxVtkBaseView3,"creaMaracasVisu viewer 2D",wxVtkBaseView*,"");
-BBTK_INPUT(ManualPaint,WxVtkBaseView4,"creaMaracasVisu viewer 2D",wxVtkBaseView*,"");
+ BBTK_NAME("ManualPaint");
+ BBTK_AUTHOR("eduardo davila (Creatis)");
+ BBTK_DESCRIPTION("Voxel manual paint");
+ BBTK_CATEGORY("widget");
+
+ BBTK_INPUT(ManualPaint,In,"Input Image / image result",vtkImageData*,"");
+ BBTK_INPUT(ManualPaint,In2,"Image result",vtkImageData*,"");
+ BBTK_INPUT(ManualPaint,WxVtkBaseView1,"creaMaracasVisu viewer 2D",wxVtkBaseView*,"");
+ BBTK_INPUT(ManualPaint,WxVtkBaseView2,"creaMaracasVisu viewer 2D",wxVtkBaseView*,"");
+ BBTK_INPUT(ManualPaint,WxVtkBaseView3,"creaMaracasVisu viewer 2D",wxVtkBaseView*,"");
+ BBTK_INPUT(ManualPaint,WxVtkBaseView4,"creaMaracasVisu viewer 2D",wxVtkBaseView*,"");
+
BBTK_END_DESCRIBE_BLACK_BOX(ManualPaint);
//=====
// Don't edit this file. This file is generated from xml description..
manualpaintmodel->SetActive( bbGetInputActive() );
manualpaintmodel->SetTool( bbGetInputTool() );
manualpaintmodel->Set2D3D( bbGetInput2D3D() );
- manualpaintmodel->SetImage( bbGetInputImage() );
+ manualpaintmodel->SetImages( bbGetInputImage(),bbGetInputImage2() );
manualpaintmodel->SetGrayLevel( bbGetInputGrayLevel() );
manualpaintmodel->SetDirection( bbGetInputDirection() );
manualpaintmodel->SetBrushSize( bbGetInputBrushSize() );
bbSetInputTool(1); // Paint
bbSetInput2D3D(1); // 3D
bbSetInputImage(NULL);
+ bbSetInputImage2(NULL);
bbSetInputGrayLevel(100);
bbSetInputDirection(2); // XY
bbSetInputBrushSize(3);
BBTK_DECLARE_INPUT(Tool,int);
BBTK_DECLARE_INPUT(2D3D,int);
BBTK_DECLARE_INPUT(Image,vtkImageData*);
+ BBTK_DECLARE_INPUT(Image2,vtkImageData*);
BBTK_DECLARE_INPUT(GrayLevel,double);
BBTK_DECLARE_INPUT(Direction,int);
BBTK_DECLARE_INPUT(BrushSize,int);
BBTK_INPUT(ManualPaint_Model,Active,"true (default) , false",bool,"");
BBTK_INPUT(ManualPaint_Model,Tool,"0=Brush, 1=Paint(default)",int,"");
BBTK_INPUT(ManualPaint_Model,2D3D,"0=2D, 1=3D (default)",int,"");
- BBTK_INPUT(ManualPaint_Model,Image,"Image input",vtkImageData*,"");
+ BBTK_INPUT(ManualPaint_Model,Image,"Image input / image result",vtkImageData*,"");
+ BBTK_INPUT(ManualPaint_Model,Image2,"Image result",vtkImageData*,"");
BBTK_INPUT(ManualPaint_Model,GrayLevel,"Fill gray level (100 default)",double,"");
BBTK_INPUT(ManualPaint_Model,Direction,"Used in the 2D mode. 0=YZ , 1=XY , 2=XY(default) ",int,"");
BBTK_INPUT(ManualPaint_Model,BrushSize,"default 3",int,"");
}
+wxVtkBaseView* ColorLayerImageViewManager::GetwxVtkBaseView(int id)
+{
+ return _colorLayerImageViewLst[id]->GetwxVtkBaseView();
+}
+
+
//----------------------------------------------------------------------------
void ColorLayerImageViewManager::SetX2(int x2)
{
public:
ColorLayerImageViewManager( );
~ColorLayerImageViewManager( );
- void SetX2(int x2);
- void SetY2(int y2);
- void SetZ2(int z2);
- virtual int GetX();
- virtual int GetY();
- virtual int GetZ();
- void SetwxVtkBaseView(int id, wxVtkBaseView *baseview);
- void SetBaseColors(std::vector<double> & base_color);
- double GetBaseColors(unsigned int index);
- void SetGreyLevelBoundaries(std::vector<double> & grey_level_boundary);
- void SetBaseTransparence(std::vector<double> & base_transparence);
- void SetRangeForColorBar(std::vector<double> & range);
- double GetGreyLevelBoundaries(unsigned int index);
- void SetPlainOrGradientColor(bool color_type);
- int GetBaseColorNb();
- void Refresh();
- void onThreshold();
- void onThresholdRemove();
- void onThresholdChange();
- void onThresholdInterpolation( bool interpolation );
- void SetSliceFixDynamic( bool fixdin );
- void onThresholdChangeOpacity( int opacity );
- void SetImage( vtkImageData* img );
+ void SetX2(int x2);
+ void SetY2(int y2);
+ void SetZ2(int z2);
+ virtual int GetX();
+ virtual int GetY();
+ virtual int GetZ();
+ void SetwxVtkBaseView(int id, wxVtkBaseView *baseview);
+ wxVtkBaseView* GetwxVtkBaseView(int id);
+ void SetBaseColors(std::vector<double> & base_color);
+ double GetBaseColors(unsigned int index);
+ void SetGreyLevelBoundaries(std::vector<double> & grey_level_boundary);
+ void SetBaseTransparence(std::vector<double> & base_transparence);
+ void SetRangeForColorBar(std::vector<double> & range);
+ double GetGreyLevelBoundaries(unsigned int index);
+ void SetPlainOrGradientColor(bool color_type);
+ int GetBaseColorNb();
+ void Refresh();
+ void onThreshold();
+ void onThresholdRemove();
+ void onThresholdChange();
+ void onThresholdInterpolation( bool interpolation );
+ void SetSliceFixDynamic( bool fixdin );
+ void onThresholdChangeOpacity( int opacity );
+ void SetImage( vtkImageData* img );
private:
std::vector< ColorLayerImageView* > _colorLayerImageViewLst;
_sl_SliceImageZ->SetRange( 0 , dim[2] );
}
+printf("EED ColorLayerImageViewPanel::SetImage UUPPSS----------------------\n" );
+printf("EED ColorLayerImageViewPanel::SetImage UUPPSS----------------------\n" );
+printf("EED ColorLayerImageViewPanel::SetImage UUPPSS----------------------\n" );
+printf("EED ColorLayerImageViewPanel::SetImage UUPPSS----------------------\n" );
+printf(" Here I have to analyse the spacing and size image to calculate new spacingvv\n" );
+printf(" I need the caracteristics of the base image\n" );
+// GetColorLayerImageViewManager()->GetwxVtkBaseView(0);
+
+
if ( (spc[0]!=_spcBase[0]) || (spc[1]!=_spcBase[1]) || (spc[2]!=_spcBase[2]) ||
(dim[0]!=_dimBase[0]) || (spc[1]!=_spcBase[1]) || (spc[2]!=_spcBase[2])
)
bool transformOkDlg;
wxString msg = _T("The image resolution of both images are not compatible. Do you want to tranform it? ");
wxDlgTransformByDimensionBySpacingByPixel dlg;
- dlg.GetTransformType(this,spc,spc,dim,dim,msg,typeOfTransformation,transformOkDlg);
+ dlg.GetTransformType(this,_spcBase,spc,_dimBase,dim,msg,typeOfTransformation,transformOkDlg);
// CM Reset the default value (Pixel i.e. 3) if the dialog box returned an inappropriate value.
if (transformOkDlg == false)
{
void SetActive(bool active);
private:
- bool _active;
- int _fitting_mode;
- int _dimBase[3];
- double _spcBase[3];
- double _spcOrg[3];
- bool _thresholdGo;
+ bool _active;
+ int _fitting_mode;
+ int _dimBase[3];
+ double _spcBase[3];
+ double _spcOrg[3];
+ bool _thresholdGo;
ColorLayerImageViewManager *_colorLayerImageViewManager;
- wxButton *_btn_ReadImage;
- wxSlider *_opacity;
- wxCheckBox *_interpolationCheckBox;
- wxCheckBox *_cb_ShowHide;
- wxCheckBox *_cb_SliceFixDinamic;
- wxSlider *_sl_SliceImageX;
- wxSlider *_sl_SliceImageY;
- wxSlider *_sl_SliceImageZ;
+ wxButton *_btn_ReadImage;
+ wxSlider *_opacity;
+ wxCheckBox *_interpolationCheckBox;
+ wxCheckBox *_cb_ShowHide;
+ wxCheckBox *_cb_SliceFixDinamic;
+ wxSlider *_sl_SliceImageX;
+ wxSlider *_sl_SliceImageY;
+ wxSlider *_sl_SliceImageZ;
//Borrame
-// mBarRange2 *_barrange2;
- Histogram* _histogram;
+// mBarRange2 *_barrange2;
+ Histogram* _histogram;
HistogramMinMaxLevel* _histogramMinMaxLevel;
void onReadImage(wxCommandEvent& event);
//---------------------------------------------------------------------------
void BrushFilter::Run() // virtual
{
+
+printf("EED nBrushFilter::Run _RangeMax %d \n",_RangeMax);
+
if (_image != NULL)
{
float value = (float) _graylevel;
FindMinMaxBrush(minX, maxX, minY, maxY, minZ, maxZ, size);
double xx, yy, zz, rr = size * size;
+ float scalarComponent;
+ bool pixelModify;
-printf("EED BrushFilter::Run() %d %d\n", _RangeMin, _RangeMax);
-
- for (i = minX; i <= maxX; i++) {
+ for (i = minX; i <= maxX; i++)
+ {
xx = _px - i;
xx = xx * xx;
- for (j = minY; j <= maxY; j++) {
+ for (j = minY; j <= maxY; j++)
+ {
yy = _py - j;
yy = yy * yy;
- for (k = minZ; k <= maxZ; k++) {
-// if ((i>=_minX) && (i<=_maxX) && (j>=_minY) && (j<=_maxY) && (k>=_minZ) && (k<=_maxZ))
-// {
-
- float scalarComponent = _image->GetScalarComponentAsFloat(i,j, k, 0);
+ for (k = minZ; k <= maxZ; k++)
+ {
+ pixelModify=false;
+ scalarComponent = _image->GetScalarComponentAsFloat(i,j, k, 0);
if ((_RangeMin <= scalarComponent)
- && (scalarComponent <= _RangeMax )) {
+ && (scalarComponent <= _RangeMax ))
+ {
if (_brushform == 0)
{
- this->_IMManager->AddModifiedPixel(i, j, k); //DFCH
- _image->SetScalarComponentFromFloat(i, j, k, 0,value);
+ pixelModify=true;
+// this->_IMManager->AddModifiedPixel(i, j, k); //DFCH
+// _image->SetScalarComponentFromFloat(i, j, k, 0,value);
} // _brushform 0
if (_brushform == 1)
{
zz = _pz - k;
zz = zz * zz;
if ((xx + yy + zz) <= rr) {
- this->_IMManager->AddModifiedPixel(i, j, k); //DFCH
- _image->SetScalarComponentFromFloat(i, j, k, 0,value);
+ pixelModify=true;
+// this->_IMManager->AddModifiedPixel(i, j, k); //DFCH
+// _image->SetScalarComponentFromFloat(i, j, k, 0,value);
}
} // _brushform 1
+ if (pixelModify==true)
+ {
+ this->_IMManager->AddModifiedPixel(i, j, k); //DFCH
+ if (_image2!=NULL)
+ {
+ _image2->SetScalarComponentFromFloat(i, j, k, 0,value);
+ }else {
+ _image->SetScalarComponentFromFloat(i, j, k, 0,value);
+ }
+ } // if pixelModify
} // GetRangeMin && GetRangeMax
-// } //if _minX _maxX _minY _maxY _minZ _maxZ
-
- } //k
- } //j
- } //i
+ } //for k
+ } //for j
+ } //for i
_image->Modified();
} else {
printf(
}
//---------------------------------------------------------------------------
-void BrushFilter::SetBrushSize(int brushsize) {
+void BrushFilter::SetBrushSize(int brushsize)
+{
_brushsize = brushsize;
}
//---------------------------------------------------------------------------
-void BrushFilter::SetBrushForm(int brushform) {
+void BrushFilter::SetBrushForm(int brushform)
+{
_brushform = brushform;
}
//---------------------------------------------------------------------------
-void BrushFilter::SetBrushTool(int brushtool) {
+void BrushFilter::SetBrushTool(int brushtool)
+{
_brushtool = brushtool;
}
-//---------------------------------------------------------------------------
-void BrushFilter::SetRangeMin(int min) {
- _RangeMin = min;
-}
-
-//---------------------------------------------------------------------------
-void BrushFilter::SetRangeMax(int max) {
- _RangeMax = max;
-}
-
-//---------------------------------------------------------------------------
-int BrushFilter::GetRangeMin() {
- return _RangeMin;
-}
-
-//---------------------------------------------------------------------------
-int BrushFilter::GetRangeMax() {
- return _RangeMax;
-}
void SetBrushSize( int brushsize );
void SetBrushForm( int brushform );
void SetBrushTool( int brushtool );
- void SetRangeMin( int min );//DFCH
- void SetRangeMax( int max );//DFCH
- int GetRangeMin( ); //DFCH
- int GetRangeMax( ); //DFCH
void FindMinMaxBrush(int &minxX,int &maxX,int &minY,int &maxY,int &minZ,int &maxZ,int &size);
virtual void Run();
int _brushsize;
int _brushform;
int _brushtool;
- int _RangeMin;
- int _RangeMax;
-
protected:
#include "FillFilter.h"
-FillFilter::FillFilter() {
- _tolerancefill = 50;
- _distancefill = 500;
+FillFilter::FillFilter()
+{
+ _tolerancefill = 50;
+ _distancefill = 500;
_limitRecursionFill = 50000;
- _auxImageFill = NULL;
+ _auxImageFill = NULL;
}
//---------------------------------------------------------------------------
-FillFilter::~FillFilter() {
+FillFilter::~FillFilter()
+{
if (_auxImageFill != NULL)
{
_auxImageFill->Delete();
}
//---------------------------------------------------------------------------
-void FillFilter::SetImage(vtkImageData *image) // virtual
- {
- baseFilterManualPaint::SetImage(image);
+void FillFilter::SetImages(vtkImageData *image,vtkImageData *image2) // virtual
+{
+ baseFilterManualPaint::SetImages(image,image2);
if (_auxImageFill != NULL)
{
_auxImageFill->Delete();
}
//---------------------------------------------------------------------------
-void FillFilter::FillToolRecursive(int px, int py, int pz) {
+void FillFilter::FillToolRecursive(int px, int py, int pz)
+{
_countRecursiveFill++;
_countProgressingFill++;
- if (_countProgressingFill > 200000) {
+ if (_countProgressingFill > 200000)
+ {
printf("R %ld \n", _countRecursiveFill);
_countProgressingFill = 0;
}
if ((px >= _minX) && (px <= _maxX) && (py >= _minY) && (py <= _maxY)
- && (pz >= _minZ) && (pz <= _maxZ)) {
- if (_usingAuxImageFill == true) {
+ && (pz >= _minZ) && (pz <= _maxZ))
+ {
+ if (_usingAuxImageFill == true)
+ {
this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
_auxImageFill->SetScalarComponentFromFloat(px, py, pz, 0, 0);
}
_tmpDistfill = (px - _pxfill) * (px - _pxfill)
+ (py - _pyfill) * (py - _pyfill)
+ (pz - _pzfill) * (pz - _pzfill);
- _tmpiglfill = _image->GetScalarComponentAsDouble(px, py, pz, 0);
+ _tmpiglfill = _image->GetScalarComponentAsDouble(px, py, pz, 0);
+
+ if (_image2!=NULL)
+ {
+ _tmpiglfill2 = _image2->GetScalarComponentAsDouble(px, py, pz, 0);
+ } else {
+ _tmpiglfill2 = _tmpiglfill;
+ }
float grayLBFMTOL = _graylevelbasefill - _tolerancefill;
float grayLBFPTOL = _graylevelbasefill + _tolerancefill;
isInRange = true;
} //fi esle
- if (isInRange) {
+ if (isInRange)
+ {
_auxGrayLevelValidationFill = (_tmpiglfill != _graylevel)
+ && (_tmpiglfill2 != _graylevel)
&& (_tmpiglfill >= grayLBFMTOL)
&& (_tmpiglfill <= grayLBFPTOL)
&& (_tmpDistfill <= _distbasefill); //DFCH
- } //fi
- else {
+ } else {
_auxGrayLevelValidationFill = false;
- } //esle
+ } // if isInRange
+
//DFCH
/*_auxGrayLevelValidationFill = (_tmpiglfill!=_graylevel) &&
(_tmpiglfill>=_graylevelbasefill-_tolerancefill) &&
(_tmpiglfill<=_graylevelbasefill+_tolerancefill) &&
(_tmpDistfill<=_distbasefill);*/ //DFCH
- if (_auxGrayLevelValidationFill == true) {
+
+ if (_auxGrayLevelValidationFill == true)
+ {
this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
- _image->SetScalarComponentFromFloat(px, py, pz, 0,
- (float) _graylevel);
+ if (_image2!=NULL)
+ {
+ _image2->SetScalarComponentFromFloat(px, py, pz, 0,(float) _graylevel);
+ } else {
+ _image->SetScalarComponentFromFloat(px, py, pz, 0,(float) _graylevel);
+ }
- if (_countRecursiveFill < _limitRecursionFill) {
+ if (_countRecursiveFill < _limitRecursionFill)
+ {
if (_2D3D == 0) //2D
- {
+ {
if (_direction == 0) // YZ
- {
+ {
//FillToolRecursive(px+1,py,pz);
//FillToolRecursive(px-1,py,pz);
FillToolRecursive(px, py + 1, pz);
} // _graylevel
if ((_auxGrayLevelValidationFill == true)
- && (_countRecursiveFill >= _limitRecursionFill)) {
+ && (_countRecursiveFill >= _limitRecursionFill))
+ {
_countRecursiveFillProblem++;
if (_2D3D == 0) //2D
}
//---------------------------------------------------------------------------
-void FillFilter::SetAuxImageFill(int px, int py, int pz) {
+void FillFilter::SetAuxImageFill(int px, int py, int pz)
+{
if ((px >= _minX) && (px <= _maxX) && (py >= _minY) && (py <= _maxY)
&& (pz >= _minZ) && (pz <= _maxZ)) {
this->_IMManager->AddModifiedPixel(px, py, pz); //DFCH
}
//---------------------------------------------------------------------------
-void FillFilter::SetToleranceFill(double tolerancefill) {
+void FillFilter::SetToleranceFill(double tolerancefill)
+{
_tolerancefill = tolerancefill;
}
//---------------------------------------------------------------------------
-void FillFilter::SetDistanceFill(int distancefill) {
+void FillFilter::SetDistanceFill(int distancefill)
+{
_distancefill = distancefill;
}
-//---------------------------------------------------------------------------
-void FillFilter::SetRangeMin(int min) {
- _RangeMin = min;
-}
-
-//---------------------------------------------------------------------------
-void FillFilter::SetRangeMax(int max) {
- _RangeMax = max;
-}
-
-//---------------------------------------------------------------------------
-int FillFilter::GetRangeMin() {
- return (_RangeMin);
-}
-//---------------------------------------------------------------------------
-int FillFilter::GetRangeMax() {
- return (_RangeMax);
-}
FillFilter();
virtual ~FillFilter();
- void Run();
- void FillToolRecursive(int px,int py, int pz);
+ void Run();
+ void FillToolRecursive(int px,int py, int pz);
- void SetToleranceFill(double tolerancefill);
- void SetDistanceFill(int distancefill);
- void SetRangeMin( int min );//DFCH
- void SetRangeMax( int max );//DFCH
- int GetRangeMin( ); //DFCH
- int GetRangeMax( ); //DFCH
- virtual void SetImage(vtkImageData *image);
+ void SetToleranceFill(double tolerancefill);
+ void SetDistanceFill(int distancefill);
+ virtual void SetImages(vtkImageData *image,vtkImageData *image2);
private:
double _tolerancefill;
double _distbasefill;
double _tmpDistfill;
double _tmpiglfill;
+ double _tmpiglfill2;
long int _countRecursiveFill;
long int _countRecursiveFillProblem;
vtkImageData *_auxImageFill;
- bool _usingAuxImageFill;
- bool _auxGrayLevelValidationFill;
+ bool _usingAuxImageFill;
+ bool _auxGrayLevelValidationFill;
long int _countProgressingFill;
long int _limitRecursionFill;
- int _RangeMin;
- int _RangeMax;
- void SetAuxImageFill(int px,int py, int pz);
+
+
+ void SetAuxImageFill(int px,int py, int pz);
protected:
}
//---------------------------------------------------------------------------
-void ManualPaintModel::SetImage(vtkImageData *image)
+void ManualPaintModel::SetImages(vtkImageData *image,vtkImageData *image2)
{
if (image!=NULL)
{
- _brushfilter->SetImage(image);
- _fillfilter->SetImage(image);
+ _brushfilter -> SetImages(image,image2);
+ _fillfilter -> SetImages(image,image2);
_imageUndoRedo->SetImage(image);
} else {
printf("EED Warning image=NULL in ManualPaintModel::SetImage(image)\n ");
void SetActive(bool active);
void SetTool(int tool);
void Set2D3D(int dim2D3D);
- void SetImage(vtkImageData *image);
+ void SetImages(vtkImageData *image,vtkImageData *image2);
void SetGrayLevel(double graylevel);
void SetDirection(int direction);
void SetBrushSize(int brushsize);
#include "baseFilterManualPaint.h"
-baseFilterManualPaint::baseFilterManualPaint() {
+baseFilterManualPaint::baseFilterManualPaint()
+{
_IMManager = new ImageMManager();
_IMManager->CleanModifiedRegion();
- _graylevel = 0.0;
- _2D3D = 1; // 0 2D , 1 true 3D
- _direction = 0; // 1 XZ , 0 YZ , 2 XY
- _minX = 0;
- _minY = 0;
- _minZ = 0;
- _maxX = 0;
- _maxY = 0;
- _maxZ = 0;
-
- _pMinX = 0;
- _pMinY = 0;
- _pMinZ = 0;
- _pMaxX = 0;
- _pMaxY = 0;
- _pMaxZ = 0;
+ _graylevel = 0.0;
+ _2D3D = 1; // 0 2D , 1 true 3D
+ _direction = 0; // 1 XZ , 0 YZ , 2 XY
+ _image = NULL;
+ _image2 = NULL;
+ _minX = 0;
+ _minY = 0;
+ _minZ = 0;
+ _maxX = 0;
+ _maxY = 0;
+ _maxZ = 0;
+
+ _pMinX = 0;
+ _pMinY = 0;
+ _pMinZ = 0;
+ _pMaxX = 0;
+ _pMaxY = 0;
+ _pMaxZ = 0;
+
+ _RangeMin = 0;
+ _RangeMax = 6000;
}
//---------------------------------------------------------------------------
}
//---------------------------------------------------------------------------
-void baseFilterManualPaint::SetImage(vtkImageData *image) {
+void baseFilterManualPaint::SetImages(vtkImageData *image, vtkImageData *image2)
+{
+ _image = image;
+ _image2 = image2;
+
int ext[6];
- _image = image;
_image->GetWholeExtent(ext);
_minX = 0;
_minY = 0;
_minZ = 0;
- _maxX = ext[1] - ext[0];
- _maxY = ext[3] - ext[2];
- _maxZ = ext[5] - ext[4];
+
+ if (_image2!=NULL)
+ {
+ int extB[6];
+ _image2->GetWholeExtent(extB);
+ _maxX = std::min( ext[1]-ext[0] , extB[1]-extB[0] );
+ _maxY = std::min( ext[3]-ext[2] , extB[3]-extB[2] );
+ _maxZ = std::min( ext[5]-ext[4] , extB[5]-extB[4] );
+ } else {
+ _maxX = ext[1]-ext[0];
+ _maxY = ext[3]-ext[2];
+ _maxZ = ext[5]-ext[4];
+ } // if
}
+
//---------------------------------------------------------------------------
void baseFilterManualPaint::ResetGeneralMinMax() {
_pMinX = 10000;
range = this->_image->GetScalarRange();
}
+//---------------------------------------------------------------------------
ImageMManager* baseFilterManualPaint::GetImageMManager() {
return (this->_IMManager);
} //DFCH
+
+//---------------------------------------------------------------------------
void baseFilterManualPaint::CleanImageMManager() {
this->_IMManager->CleanModifiedRegion();
} //DFCH
+
+
+
+//---------------------------------------------------------------------------
+void baseFilterManualPaint::SetRangeMin(int min)
+{
+ _RangeMin = min;
+}
+
+//---------------------------------------------------------------------------
+void baseFilterManualPaint::SetRangeMax(int max)
+{
+ _RangeMax = max;
+}
+
+//---------------------------------------------------------------------------
+int baseFilterManualPaint::GetRangeMin()
+{
+ return _RangeMin;
+}
+
+//---------------------------------------------------------------------------
+int baseFilterManualPaint::GetRangeMax()
+{
+ return _RangeMax;
+}
+
+
+
+
baseFilterManualPaint();
virtual ~baseFilterManualPaint();
- virtual void SetImage(vtkImageData *image);
+ virtual void SetImages(vtkImageData *image,vtkImageData *image2);
void SetPoint(int px, int py, int pz);
void Set2D3D(int dim2D3D);
void SetGrayLevel(double graylevel);
void SetDirection(int direction);
void ResetGeneralMinMax();
- void SetGeneralMinMax(int minX, int maxX, int minY, int maxY, int minZ,
- int maxZ);
+ void SetGeneralMinMax(int minX, int maxX, int minY, int maxY, int minZ, int maxZ);
void GetScalarRange(double * range);
+
+ void SetRangeMin( int min );//DFCH
+ void SetRangeMax( int max );//DFCH
+ int GetRangeMin( ); //DFCH
+ int GetRangeMax( ); //DFCH
+
ImageMManager* GetImageMManager(); //DFCH
void CleanImageMManager(); //DFCH
virtual void Run();
private:
protected:
- ImageMManager *_IMManager; //Saves the last modified region (MinX, MaxX, MinY, MaxY, MinZ, MaxZ).
- vtkImageData *_image;
- int _direction;
- int _px; // start point of the brush
- int _py;
- int _pz;
- int _pMinX; // General min max of many brush actions
- int _pMinY;
- int _pMinZ;
- int _pMaxX;
- int _pMaxY;
- int _pMaxZ;
- int _minX; // min max of the image
- int _maxX;
- int _minY;
- int _maxY;
- int _minZ;
- int _maxZ;
- bool _2D3D;
- double _graylevel;
+ ImageMManager *_IMManager; //Saves the last modified region (MinX, MaxX, MinY, MaxY, MinZ, MaxZ).
+ vtkImageData *_image;
+ vtkImageData *_image2;
+ int _direction;
+ int _px; // start point of the brush
+ int _py;
+ int _pz;
+ int _pMinX; // General min max of many brush actions
+ int _pMinY;
+ int _pMinZ;
+ int _pMaxX;
+ int _pMaxY;
+ int _pMaxZ;
+ int _minX; // min max of the image
+ int _maxX;
+ int _minY;
+ int _maxY;
+ int _minZ;
+ int _maxZ;
+ bool _2D3D;
+ double _graylevel;
+ int _RangeMin;
+ int _RangeMax;
+
+
};
#endif // _BASE_FILTER_MANUAL_PAINT_H_
//Title
sizer->Add( tittleText );
//giving some blank spaces
- sizer->Add( new wxStaticText( this, -1, _T(" ") ) );
+ sizer->Add( new wxStaticText( this, -1, _T(" key A : Enable/Disable ") ) );
this->ConfigureActiveCBButton( );
this->ConfigureBrushToolRadioButton( );
this->_gConfigSizer = new wxFlexGridSizer( 1 );
//BrushTool Radio Button
//giving blank space
- this->_gConfigSizer->Add(
- new wxStaticText( this, -1, _T(" ") ) );
+ this->_gConfigSizer->Add( new wxStaticText( this, -1, _T(" ") ) );
//end of blank space
this->_gConfigSizer->Add( _rbBrushTool, 1, wxGROW );
//2D/3D Radio Button