BBTK_DECLARE_INPUT(lstBaseColor,std::vector<double>);
BBTK_DECLARE_INPUT(lstGreyLevelBoundaries,std::vector<double>);
BBTK_DECLARE_INPUT(PlainOrGradientColor,bool);
+ BBTK_DECLARE_INPUT(FittingMode,int);
BBTK_PROCESS(Process);
void Process();
BBTK_CREATE_WIDGET(CreateWidget);
BBTK_INPUT(ColorLayerImageView,lstBaseColor,"List of Base Colors in RGB format to define the color map. Requirement: must be of a size being a multiple of 3, with values between 0 and 1. For example, for 2 colors: \"1 0 0 0 0 1\". If not provided as required, the histogram is equally split into three areas, blue, yellow and red.",std::vector<double>,"");
BBTK_INPUT(ColorLayerImageView,lstGreyLevelBoundaries,"List of the Grey Level Boundaries to define the color map. Requirement: Must have one more element than the number of colours. For example, for 2 colors: \"50 150 250\". If not provided as required, the histogram is equally split into areas, which number corresponds to the number of colors provided (3 by default).",std::vector<double>,"");
BBTK_INPUT(ColorLayerImageView,PlainOrGradientColor,"Choose between Plain (true) or Gradient (false) colors. Default is false.",bool,"");
+BBTK_INPUT(ColorLayerImageView,FittingMode,"Choose the fitting mode between the images, the transformation can be either by Dimension (1), by Spacing (2) or by Pixel (3). If you want to make the choice through a dialog box, choose (-1). Default is by Pixel (3).",int,"");
BBTK_END_DESCRIBE_BLACK_BOX(ColorLayerImageView);
//=====
// Don't edit this file. This file is generated from xml description..
dial->ShowModal();
typeOfTransformation = -1;
- dlgWxOK = false;
+ dlgWxOK = false;
if (dial->GetReturnCode() == wxID_OK)
{
- typeOfTransformation = radioOpts->GetSelection();
- dlgWxOK = true;
+ typeOfTransformation = radioOpts->GetSelection() + 1;
+ dlgWxOK = true;
}
}
this->SetSizer( sizer );
this->SetAutoLayout( true );
this->Layout();
+
+ //CM Sets the default fitting mode to Pixel mode.
+ _fitting_mode = 3;
+ // EO CM
}
//----------------------------------------------------------------------------
(dim[0]!=_dimBase[0]) || (spc[1]!=_spcBase[1]) || (spc[2]!=_spcBase[2])
)
{
-
- bool transformOkDlg;
- int typeOfTransformation;
- wxString msg = _T("The image resolution of both images are not compatible. Do you want to tranform it? ");
- wxDlgTransformByDimensionBySpacingByPixel dlg;
- dlg.GetTransformType(this,msg,typeOfTransformation,transformOkDlg);
-
- printf("EED ColorLayerImageViewPanel::onReadImage call dialog spc size,dim...???\n");
-
- if (typeOfTransformation==0) // make dimensions equals
+ // CM
+ int typeOfTransformation;
+ // In case of the option is set to create a dialog box.
+ if (_fitting_mode == -1)
+ {
+ 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,msg,typeOfTransformation,transformOkDlg);
+ // CM Reset the default value (Pixel i.e. 3) if the dialog box returned an inappropriate value.
+ if (transformOkDlg == false)
+ typeOfTransformation = 3;
+ }
+ else
+ typeOfTransformation = _fitting_mode;
+ //EO CM
+
+ printf("EED ColorLayerImageViewPanel::onReadImage call dialog spc size,dim...???\n");
+
+ if (typeOfTransformation==1) // make dimensions equals
{
printf("EED ColorLayerImageViewPanel::onReadImage ...WARNNING.... dif size image spc*dim ofnew image ...???\n");
spc[0]=_spcBase[0]*_dimBase[0]/dim[0];
spc[2] = 1;
}
- if (typeOfTransformation==1) // make spacing equals
+ if (typeOfTransformation==2) // make spacing equals
{
spc[0] = ( _spcBase[0]/spc[0] ) * _spcOrg[0];
spc[1] = ( _spcBase[1]/spc[1] ) * _spcOrg[1];
spc[2] = ( _spcBase[2]/spc[2] ) * _spcOrg[2];
}
- if (typeOfTransformation==2) // make spacing = 1
+ if (typeOfTransformation==3) // make spacing = 1
{
spc[0] = 1;
spc[1] = 1;
}
}
+//----------------------------------------------------------------------------
+void ColorLayerImageViewPanel::SetFittingMode(int fitting_mode)
+{
+ // CM Sets the fitting mode if an appropriate value is provided.
+ if (fitting_mode == -1 || fitting_mode == 1 || fitting_mode == 2 || fitting_mode == 3)
+ {
+ _fitting_mode = fitting_mode;
+ }
+ //Otherwise, an exception should be thrown (value 0 is fine, it corresponds to an empty field i.e. the default value is kept).
+ else if (fitting_mode != 0)
+ std::cout << "CM ERROR!!! The fitting mode provided has an inappropriate value. It should be an int between -1 ; 1 ; 2 ; 3, but its value is :" << fitting_mode << ". The default value will be set instead, i.e. Pixel transformation (3)." << std::endl;
+ //EO CM
+}
+
+//----------------------------------------------------------------------------
+int ColorLayerImageViewPanel::GetFittingMode()
+{
+ return _fitting_mode;
+}
+
//----------------------------------------------------------------------------
void ColorLayerImageViewPanel::onReadImage(wxCommandEvent& event)
{