Commit 4b88f878 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] readRaw now supports datasets with non-uniform voxel scalings.

parent b26c6f44
......@@ -106,6 +106,13 @@ void WMReadRawData::properties()
m_Z->setMin( 0 );
m_Z->setMax( 1024 );
m_xScale = m_properties->addProperty( "X Scale", "Data scaling in X direction.", 1.0, m_propCondition );
m_xScale->setMin( 0 );
m_yScale = m_properties->addProperty( "Y Scale", "Data scaling in Y direction.", 1.0, m_propCondition );
m_yScale->setMin( 0 );
m_zScale = m_properties->addProperty( "Z Scale", "Data scaling in Z direction.", 1.0, m_propCondition );
m_zScale->setMin( 0 );
WModule::properties();
}
......@@ -196,7 +203,7 @@ boost::shared_ptr< WDataSetScalar > WMReadRawData::readData( std::string fileNam
size_t numX = m_X->get();
size_t numY = m_Y->get();
size_t numZ = m_Z->get();
newGrid = boost::shared_ptr< WGridRegular3D >( new WGridRegular3D( numX, numY, numZ ) );
newGrid = boost::shared_ptr< WGridRegular3D >( new WGridRegular3D( numX, numY, numZ, m_xScale->get(), m_yScale->get(), m_zScale->get() ) );
boost::shared_ptr< WDataSetScalar > newDataSet;
newDataSet = boost::shared_ptr< WDataSetScalar >( new WDataSetScalar( newValueSet, newGrid ) );
......
......@@ -127,6 +127,10 @@ private:
WPropInt m_Y; //!< Samples in Y direction
WPropInt m_Z; //!< Samples in Z direction
WPropDouble m_xScale; //!< Scaling in X direction
WPropDouble m_yScale; //!< Scaling in Y direction
WPropDouble m_zScale; //!< Scaling in Z direction
boost::shared_ptr< WItemSelection > m_dataTypeSelectionsList; //!< A list of file type selection types
WPropSelection m_dataTypeSelection; //!< Selection property for file types
......@@ -146,7 +150,6 @@ boost::shared_ptr< std::vector< T > > WMReadRawData::readDataTyped( std::string
boost::shared_ptr< std::vector< T > > values;
values = boost::shared_ptr< std::vector< T > >( new std::vector< T >( numVoxels ) );
std::ifstream ifs;
ifs.open( fileName.c_str(), std::ifstream::in|std::ios::binary );
if( !ifs || ifs.bad() )
......
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