Commit fcacc102 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[MERGE]

parents 677a782b 03f3381b
......@@ -32,8 +32,6 @@
#include "../../common/math/WSymmetricSphericalHarmonic.h"
#include "../../common/WLimits.h"
#include "../../common/exceptions/WPreconditionNotMet.h"
#include "../../dataHandler/WDataHandler.h"
#include "../../dataHandler/WDataTexture3D.h"
#include "../../graphicsEngine/WROIBox.h"
#include "../../kernel/WKernel.h"
#include "../../kernel/WROIManager.h"
......@@ -208,11 +206,6 @@ void WMBermanTracking::moduleMain()
if( m_dataSet && m_dataSetResidual && m_gfa )
{
if( m_result )
{
WDataHandler::deregisterDataSet( m_result );
}
// calculate some matrices needed for the residuals
std::vector< wmath::WUnitSphereCoordinates > c;
for( std::size_t i = 0; i < m_dataSetResidual->getOrientations().size(); ++i )
......@@ -258,16 +251,11 @@ void WMBermanTracking::moduleMain()
m_result = boost::shared_ptr< WDataSetScalar >( new WDataSetScalar( vs, m_dataSet->getGrid() ) );
m_result->setFileName( "Berman_prob_tracking_result" );
// { TODO(ebaum): this is deprecated and will be replaced by WGEColormapping
m_result->getTexture()->setThreshold( 0.05f );
m_result->getTexture()->setSelectedColormap( 2 );
m_result->getTexture()->setInterpolation( false );
// }
m_result->getTexture2()->threshold()->set( 0.05f );
m_result->getTexture2()->colormap()->set( m_result->getTexture2()->colormap()->get().newSelector( WItemSelector::IndexList( 1, 2 ) ) );
m_result->getTexture2()->interpolation()->set( false );
m_output->updateData( m_result );
WDataHandler::registerDataSet( m_result );
m_hits = boost::shared_ptr< std::vector< float > >();
}
......
......@@ -28,10 +28,6 @@
#include <vector>
#include "../../kernel/WKernel.h"
#include "../../dataHandler/WDataHandler.h"
// { TODO(ebaum): this is deprecated and will be replaced by WGEColormapping
#include "../../dataHandler/WDataTexture3D.h"
// }
#include "../../dataHandler/WDataTexture3D_2.h"
#include "../../graphicsEngine/WGEColormapping.h"
#include "../../common/WPropertyHelper.h"
......@@ -39,7 +35,6 @@
#include "WMImageExtractor.xpm"
#include "WMImageExtractor.h"
// This line is needed by the module loader to actually find your module.
W_LOADABLE_MODULE( WMImageExtractor )
WMImageExtractor::WMImageExtractor():
......@@ -100,32 +95,6 @@ void WMImageExtractor::properties()
m_maxValuePct->setMin( 0.0 );
m_maxValuePct->setMax( 100.0 );
// { TODO(ebaum): this is deprecated and will be replaced by WGEColormapping
// these are taken from WMData
m_interpolation = m_properties->addProperty( "Interpolation",
"If active, the boundaries of single voxels"
" will not be visible in colormaps. The transition between"
" them will be smooth by using interpolation then.",
true,
m_propCondition );
m_threshold = m_properties->addProperty( "Threshold", "Values below this threshold will not be "
"shown in colormaps.", 0., m_propCondition );
m_opacity = m_properties->addProperty( "Opacity %", "The opacity of this data in colormaps combining"
" values from several data sets.", 100, m_propCondition );
m_opacity->setMax( 100 );
m_opacity->setMin( 0 );
m_colorMapSelectionsList = boost::shared_ptr< WItemSelection >( new WItemSelection() );
m_colorMapSelectionsList->addItem( "Grayscale", "" );
m_colorMapSelectionsList->addItem( "Rainbow", "" );
m_colorMapSelectionsList->addItem( "Hot iron", "" );
m_colorMapSelectionsList->addItem( "Red-Yellow", "" );
m_colorMapSelectionsList->addItem( "Blue-Lightblue", "" );
m_colorMapSelectionsList->addItem( "Blue-Green-Purple", "" );
m_colorMapSelection = m_properties->addProperty( "Colormap", "Colormap type.", m_colorMapSelectionsList->getSelectorFirst(), m_propCondition );
WPropertyHelper::PC_SELECTONLYONE::addTo( m_colorMapSelection );
// }
WModule::properties();
}
......@@ -133,9 +102,6 @@ void WMImageExtractor::activate()
{
if( m_outData )
{
// { TODO(ebaum): this is deprecated and will be replaced by WGEColormapping
m_outData->getTexture()->setGloballyActive( m_active->get() );
// }
m_outData->getTexture2()->active()->set( m_active->get() );
}
WModule::activate();
......@@ -178,30 +144,22 @@ void WMImageExtractor::moduleMain()
if( m_outData )
{
WDataHandler::deregisterDataSet( m_outData );
m_properties->removeProperty( m_outData->getTexture2()->getProperties() );
m_infoProperties->removeProperty( m_outData->getTexture2()->getInformationProperties() );
WGEColormapping::deregisterTexture( m_outData->getTexture2() );
}
std::size_t i = static_cast< std::size_t >( m_selectedImage->get( true ) );
WGEColormapping::deregisterTexture( m_outData->getTexture2() );
boost::shared_ptr< WDataSetScalar > oldOut = m_outData;
m_outData = extract( i );
if( m_outData )
{
// { TODO(ebaum): this is deprecated and will be replaced by WGEColormapping
if( m_outData != oldOut )
{
m_threshold->setMin( m_outData->getMin() - 1 );
m_threshold->setMax( m_outData->getMax() );
m_threshold->set( m_outData->getMin() - 1 );
}
// }
setOutputProps();
m_outData->setFileName( makeImageName( i ) );
// { TODO(ebaum): this is deprecated and will be replaced by WGEColormapping
WDataHandler::registerDataSet( m_outData );
// }
// provide the texture's properties as own properties
m_properties->addProperty( m_outData->getTexture2()->getProperties() );
m_infoProperties->addProperty( m_outData->getTexture2()->getInformationProperties() );
......@@ -225,9 +183,6 @@ void WMImageExtractor::moduleMain()
m_properties->removeProperty( m_outData->getTexture2()->getProperties() );
m_infoProperties->removeProperty( m_outData->getTexture2()->getInformationProperties() );
WGEColormapping::deregisterTexture( m_outData->getTexture2() );
// { TODO(ebaum): this is deprecated and will be replaced by WGEColormapping
WDataHandler::deregisterDataSet( m_outData );
// }
}
m_outData = boost::shared_ptr< WDataSetScalar >();
m_output->updateData( m_outData );
......@@ -238,7 +193,9 @@ void WMImageExtractor::moduleMain()
if( m_outData )
{
WDataHandler::deregisterDataSet( m_outData );
m_properties->removeProperty( m_outData->getTexture2()->getProperties() );
m_infoProperties->removeProperty( m_outData->getTexture2()->getInformationProperties() );
WGEColormapping::deregisterTexture( m_outData->getTexture2() );
}
debugLog() << "Finished! Good Bye!";
......@@ -416,14 +373,6 @@ void WMImageExtractor::setOutputProps()
float fmin = static_cast< float >( min + ( max - min ) * m_minValuePct->get( true ) * 0.01 );
float fmax = static_cast< float >( min + ( max - min ) * m_maxValuePct->get( true ) * 0.01 );
// { TODO(ebaum): this is deprecated and will be replaced by WGEColormapping
m_outData->getTexture()->setMinValue( fmin );
m_outData->getTexture()->setMaxValue( std::max( fmax, fmin + 1.0f ) );
m_outData->getTexture()->setThreshold( m_threshold->get( true ) );
m_outData->getTexture()->setOpacity( m_opacity->get( true ) );
m_outData->getTexture()->setInterpolation( m_interpolation->get( true ) );
m_outData->getTexture()->setSelectedColormap( m_colorMapSelection->get( true ).getItemIndexOfSelected( 0 ) );
// }
m_outData->getTexture2()->minimum()->set( fmin );
m_outData->getTexture2()->scale()->set( std::max( fmax, fmin + 1.0f ) - fmin );
}
......
......@@ -138,34 +138,6 @@ private:
//! The data value percent that maps to 1.0 in the texture.
WPropDouble m_maxValuePct;
// { TODO(ebaum): this is deprecated and will be replaced by WGEColormapping
// the following 5 members are taken from WMData
/**
* Interpolation?
*/
WPropBool m_interpolation;
/**
* A list of color map selection types
*/
boost::shared_ptr< WItemSelection > m_colorMapSelectionsList;
/**
* Selection property for color map
*/
WPropSelection m_colorMapSelection;
/**
* Threshold value for this data.
*/
WPropDouble m_threshold;
/**
* Opacity value for this data.
*/
WPropInt m_opacity;
// }
/**
* An input connector that accepts order 1 datasets.
*/
......
......@@ -35,9 +35,10 @@
#include "itkGradientAnisotropicDiffusionImageFilter.h"
#include "itkCastImageFilter.h"
#include "../../graphicsEngine/WROIBox.h"
#include "../../kernel/WKernel.h"
#include "../../kernel/WROIManager.h"
#include "../../graphicsEngine/WROIBox.h"
#include "../../dataHandler/WITKImageConversion.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment