Skip to content
Snippets Groups Projects
Commit f97c5315 authored by Julien Michel's avatar Julien Michel
Browse files

ENH: Fixing the pixel description to display all values

parent 113ad91e
Branches
Tags
No related merge requests found
...@@ -28,6 +28,8 @@ PixelDescriptionView<TInputPixelDescription> ...@@ -28,6 +28,8 @@ PixelDescriptionView<TInputPixelDescription>
{ {
// build a widget with a default size // build a widget with a default size
m_PixelDescriptionWidget = new Fl_Multiline_Output(0,0,200,40); m_PixelDescriptionWidget = new Fl_Multiline_Output(0,0,200,40);
m_PixelDescriptionWidget->textsize(10);
m_PixelDescriptionWidget->textfont(FL_SCREEN);
m_PixelDescriptionWidget->deactivate(); m_PixelDescriptionWidget->deactivate();
} }
......
...@@ -113,11 +113,54 @@ public: ...@@ -113,11 +113,54 @@ public:
{ {
itk::OStringStream oss; itk::OStringStream oss;
OutputPixelType output = this->Evaluate(vpixel); OutputPixelType output = this->Evaluate(vpixel);
oss<<"R[chan=" <<m_RedChannelIndex <<" val="<< static_cast<typename itk::NumericTraits<ScalarPixelType>::PrintType>(vpixel[m_RedChannelIndex]) <<" disp="<<static_cast<unsigned int>(output[0])<<"]\n";
oss<<"G[chan="<<m_GreenChannelIndex <<" val="<< static_cast<typename itk::NumericTraits<ScalarPixelType>::PrintType>(vpixel[m_GreenChannelIndex]) <<" disp="<<static_cast<unsigned int>(output[1])<<"]\n";
oss<<"B[chan=" <<m_BlueChannelIndex <<" val="<< static_cast<typename itk::NumericTraits<ScalarPixelType>::PrintType>(vpixel[m_BlueChannelIndex]) <<" disp="<<static_cast<unsigned int>(output[2])<<"]";
return oss.str();
for(unsigned int channel = 0; channel < vpixel.Size();++channel)
{
if(channel == m_RedChannelIndex)
{
oss<<"c= "<<channel<<", R= "<<(int)output[0];
if(output[0]<100)
{
oss<<" ";
}
if(output[0]<10)
{
oss<<" ";
}
oss<<", v= "<<static_cast<typename itk::NumericTraits<ScalarPixelType>::PrintType>(vpixel[channel])<<std::endl;
}
else if(channel == m_BlueChannelIndex)
{
oss<<"c= "<<channel<<", G= "<<(int)output[1];
if(output[1]<100)
{
oss<<" ";
}
if(output[1]<10)
{
oss<<" ";
}
oss<<", v= "<<static_cast<typename itk::NumericTraits<ScalarPixelType>::PrintType>(vpixel[channel])<<std::endl;
}
else if(channel == m_GreenChannelIndex)
{
oss<<"c= "<<channel<<", B= "<<(int)output[2];
if(output[2]<100)
{
oss<<" ";
}
if(output[2]<10)
{
oss<<" ";
}
oss<<", v= "<<static_cast<typename itk::NumericTraits<ScalarPixelType>::PrintType>(vpixel[channel])<<std::endl;
}
else
{
oss<<"c= "<<channel<<", v= "<<static_cast<typename itk::NumericTraits<ScalarPixelType>::PrintType>(vpixel[channel])<<std::endl;
}
}
return oss.str();
} }
/** Get the transfer function for tuning */ /** Get the transfer function for tuning */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment