[OpenWalnut-Dev] Write file reader for WDataSetScalar

Sebastian Eichelbaum eichelbaum at informatik.uni-leipzig.de
Wed May 23 11:59:26 CEST 2012


Awesome! :-)

To change the dataset transformation, the grid your provide to the dataset can be modified. When constructing the grid, you provide a WGridTranaformOrtho. This allows you to change axes and similar.

Bye
Sebastian

On Wed, 23 May 2012, Frank Zisko wrote:

> Hi,
> 
> I did it. In retrospect it was pretty easy. m(
> The constructor of WValueSetBase allows initializing without datatypedef
> (here W_DT_UINT8), so I did it (wrong).
> 
> Thanks to all, who helped me!
> 
> Greetings
> Frank
> 
> 
> 
> ps: Does anyone have a simple idea on how to change axes interchanged
> and the voxel size (mm)? With the transformation matrix?
> 
> ################################################################
> 
> My false attempt:
> 
> 
>     boost::shared_ptr< std::vector< int > > myData =  boost::shared_ptr<
> std::vector< int > >( new std::vector< int >( voxelCount ) );
> [...]
>     boost::shared_ptr< WValueSetBase > myValueSet;
>     myValueSet = boost::shared_ptr< WValueSetBase >( new WValueSet< int
> >( order, tensorDim, myData ) );
>     // DON'T FORGET TO EDIT SPACING PROPERTIES FROM DATA SET INTO
> WDATASETSCALAR!
>     boost::shared_ptr< WGrid > myGrid;
>     // Transformation of data block
>     myGrid = boost::shared_ptr< WGridRegular3D >( new
> WGridRegular3D( dimX, dimY, dimZ, ( WMatrix< double >( 4, 4
> ).makeIdentity() )));
> 
>     boost::shared_ptr< WDataSet > myDataSet;
>     myDataSet = boost::shared_ptr< WDataSet >( new
> WDataSetScalar( myValueSet, myGrid ) );
>     myDataSet->setFilename( m_fname );
>     m_ifs->close();
>     wlog::debug( "WReader" ) << "Reading Volume ... Done.";
>     return myDataSet;
> 
> ################################################################
> 
> Correct attempt:
> 
>     boost::shared_ptr< std::vector< uint8_t > > myData =
> boost::shared_ptr< std::vector< uint8_t > >( new std::vector< uint8_t
> >( voxelCount ) );
> [...]
>     boost::shared_ptr< WValueSetBase > myValueSet;
>     myValueSet = boost::shared_ptr< WValueSetBase >( new WValueSet<
> uint32_t >( order, tensorDim, myData, W_DT_UINT8 ) );
>     // DON'T FORGET TO EDIT SPACING PROPERTIES FROM DATA SET INTO
> WDATASETSCALAR!
>     boost::shared_ptr< WGrid > myGrid;
>     // Transformation of data block
>     myGrid = boost::shared_ptr< WGridRegular3D >( new
> WGridRegular3D( dimX, dimY, dimZ, ( WMatrix< double >( 4, 4
> ).makeIdentity() )));
> 
>     boost::shared_ptr< WDataSet > myDataSet;
>     myDataSet = boost::shared_ptr< WDataSet >( new
> WDataSetScalar( myValueSet, myGrid ) );
>     myDataSet->setFilename( m_fname );
>     m_ifs->close();
>     wlog::debug( "WReader" ) << "Reading Volume ... Done.";
>     return myDataSet;
> 
> 
> _______________________________________________
> OpenWalnut-Dev mailing list
> OpenWalnut-Dev at lists.informatik.uni-leipzig.de
> http://lists.informatik.uni-leipzig.de/mailman/listinfo/openwalnut-dev
> 
> Archive: http://lists.informatik.uni-leipzig.de/pipermail/openwalnut-dev/
> 

-- 
Dipl.-Inf. Sebastian Eichelbaum
Universität Leipzig
Institut für Informatik
Abteilung Bild- und Signalverarbeitung
PF 100920
D-04009 Leipzig


More information about the OpenWalnut-Dev mailing list