Commit e7a38e35 authored by Alexander Wiebel's avatar Alexander Wiebel
Browse files

[ADD] support for one more data type in some modules

parent b47af170
......@@ -222,6 +222,7 @@ void WMData::moduleMain()
{
case W_DT_UNSIGNED_CHAR:
case W_DT_INT16:
case W_DT_UINT16:
case W_DT_SIGNED_INT:
m_dataSet->getTexture()->colormap()->set(
m_dataSet->getTexture()->colormap()->get().newSelector( WItemSelector::IndexList( 1, 0 ) )
......@@ -244,7 +245,7 @@ void WMData::moduleMain()
}
break;
default:
WAssert( false, "Unknow data type in Data module" );
WAssert( false, "Unknown data type in Data module" );
}
}
}
......
......@@ -145,7 +145,13 @@ boost::shared_ptr< WDataSet > WReaderNIfTI::load( DataSetType dataSetType )
newValueSet = boost::shared_ptr< WValueSetBase >( new WValueSet< int16_t >( order, vDim, data, W_DT_INT16 ) );
break;
}
case DT_UINT16:
{
boost::shared_ptr< std::vector< uint16_t > > data
= copyArray( reinterpret_cast< uint16_t* >( filedata->data ), countVoxels, vDim );
newValueSet = boost::shared_ptr< WValueSetBase >( new WValueSet< uint16_t >( order, vDim, data, W_DT_UINT16 ) );
break;
}
case DT_INT32:
{
boost::shared_ptr< std::vector< int32_t > > data = copyArray( reinterpret_cast< int32_t* >( filedata->data ), countVoxels, vDim );
......@@ -167,7 +173,6 @@ boost::shared_ptr< WDataSet > WReaderNIfTI::load( DataSetType dataSetType )
newValueSet = boost::shared_ptr< WValueSetBase >( new WValueSet< double >( order, vDim, data, W_DT_DOUBLE ) );
break;
}
default:
wlog::error( "WReaderNIfTI" ) << "unknown data type " << header->datatype << std::endl;
newValueSet = boost::shared_ptr< WValueSetBase >();
......
......@@ -283,6 +283,28 @@ void WMMarchingCubes::generateSurfacePre( double isoValue )
}
break;
}
case W_DT_UINT16:
{
boost::shared_ptr< WValueSet< uint16_t > > vals;
vals = boost::shared_dynamic_cast< WValueSet< uint16_t > >( ( *m_dataSet ).getValueSet() );
WAssert( vals, "Data type and data type indicator must fit." );
if( m_useMarchingLego->get( true ) )
{
m_triMesh = mlAlgo.generateSurface( m_grid->getNbCoordsX(), m_grid->getNbCoordsY(), m_grid->getNbCoordsZ(),
m_grid->getTransformationMatrix(),
vals->rawDataVectorPointer(),
isoValue );
}
else
{
m_triMesh = mcAlgo.generateSurface( m_grid->getNbCoordsX(), m_grid->getNbCoordsY(), m_grid->getNbCoordsZ(),
m_grid->getTransformationMatrix(),
vals->rawDataVectorPointer(),
isoValue,
m_progress );
}
break;
}
case W_DT_SIGNED_INT:
{
boost::shared_ptr< WValueSet< int32_t > > vals;
......
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