[OpenWalnut-Dev] Write file reader for WDataSetScalar

Frank Zisko frank.zisko at gmx.net
Sun May 20 16:14:51 CEST 2012


I'm very sorry for my late reply. I was very busy in the last days.


> Please be a little bit more specific. What is the error in the histogramView? You verified that each value is between 0-255? Is it possible to send your most recent dataset you wrote with OW as nifti?
> 
I verified each value while reading and count them. The number is same as number of voxels.

The most recent set is in the dropboxfolder "output_05":
https://www.dropbox.com/sh/k4s36ih29d0r56d/9PsnCXgbTn/output_05_OK.nii.gz
from folder:
https://www.dropbox.com/sh/k4s36ih29d0r56d/zAdsTKRkrr

If needed I can send more code and example data sets. But unfortunately, only private.

The HistogramView error ist the following:

*INFO    [HistogramView] Recalculating histogram. 
Exception thrown! Callstack's backtrace:
trace: WException::WException(std::exception const&)	->
lib/libopenwalnut.so.1(_ZN10WExceptionC1ERKSt9exception+0x135)
[0x7f2596a9ad65]
trace: WThreadedRunner::threadMainSave()	->
lib/libopenwalnut.so.1(_ZN15WThreadedRunner14threadMainSaveEv+0xba)
[0x7f2596a9e23a]
trace: boost::detail::thread_data<boost::function<void ()> >::run()	->
lib/libopenwalnut.so.1(_ZN5boost6detail11thread_dataINS_8functionIFvvEEEE3runEv+0x1e) [0x7f2596aa10ae]
trace: thread_proxy()	->	/usr/lib/libboost_thread.so.1.46.1(thread_proxy
+0x69) [0x7f2592f36ce9]
trace: ()	->	/usr/lib/nvidia-current-updates/libGL.so.1(+0xa7b74)
[0x7f259012cb74]

*ERROR   [KernelRootContainer] Error in module "HistogramView".
Forwarding to nesting container. 
*INFO    [ModuleContainer (KernelRootContainer)] Disconnecting Data
Module:out from HistogramView:Input dataset #0 
*ERROR   [Module (HistogramView)] WException. Notifying. Message:
vector::_M_range_check 

Greetings 

Frank







> 
> On Mon, 14 May 2012, Frank Zisko wrote:
> 
> > Now I got the correct order. In imagej I can see the data set
> > output_04.nii.gz correctly. But OW is still black. When I re-read the
> > saved output.nii datas, too. The HistogrammView is also on error. I
> > don't get my misstake.
> > All values are int between 0 and 255;
> > 
> > Am Montag, den 14.05.2012, 21:36 +0200 schrieb Frank Zisko:
> > > Hi,
> > > 
> > > I changed the read mode. But ... I'm still confused.
> > > 
> > > I looked at file in imagej. It looks a super little bit better, but it's
> > > still wrong.
> > > 
> > > Here some data sets in a shared dropbox folder:
> > > https://www.dropbox.com/sh/u1iiga8nrs4vosv/gdsPaPSd7W
> > > ( see in comments what changes makes the datasets )
> > > 
> > > I'm not shure if the mode of reading the volume is the only one error I
> > > do. I can'T display the HistogrammView for any data set. 
> > > 
> > > 
> > > 
> > > 
> > > SOURCE
> > > 
> > > #include ...
> > > [...]
> > > boost::shared_ptr< WDataSet > WReaderMy::read()
> > > {
> > >      m_ifs = boost::shared_ptr< std::ifstream >( new std::ifstream() );
> > >      m_ifs->open( m_fname.c_str(), std::ifstream::in |
> > > std::ifstream::binary );
> > > [...]
> > >      wlog::info( "WReaderMy" ) << "Read array ...";
> > >      // My Data Array.
> > >      int voxelCount = dimX * dimY * dimZ;
> > >      int tensorDim = 1; // Scalar values.
> > >      int order = 0; // ?
> > >      boost::shared_ptr< std::vector< int > > myData =   
> > > boost::shared_ptr< std::vector< int > >( new std::vector< int >(  
> > > voxelCount ) );
> > > 
> > > // ##################################################
> > >     int tmp = 0;
> > >     int index = 0;
> > >     for( int x = 0; x < dimX; x++)
> > >     {
> > >         for(int y = 0; y < dimY; y++)
> > >         {
> > >             for(int z = 0; z < dimZ; z++)
> > >             {
> > >                 m_ifs->read( reinterpret_cast<char*>(&tmp),1 );
> > >                 //index = x*dimY*dimZ + y*dimZ + z; // output_01
> > >                 //index = (voxelCount-1) - (x*dimY*dimZ + y*dimZ +
> > > z); // output_02 reversed output_01
> > >                 //index = (dimX-1-x) + y*(dimX-1) +
> > > z*(dimX-1)*(dimY-1); // output_03
> > >                 index = z*dimY*dimX + y*dimX + x; // output_04
> > >                 (*vmrData)[index] = tmp;
> > >             }
> > >         }
> > >     }
> > >  // ###########################################
> > >      wlog::info( "WReaderMy" ) << "Read array ... Done.";
> > > 
> > >      boost::shared_ptr< WValueSetBase > myValueSet; // For creatiung  
> > > DataSetScalar ( WValueSetBase, WGrid).
> > >      myValueSet = boost::shared_ptr< WValueSetBase >( new WValueSet<  
> > > int >( order, tensorDim, myData) );
> > > 
> > > 
> > > [...]
> > >      boost::shared_ptr< WGrid > myGrid;
> > >      myGrid = boost::shared_ptr< WGridRegular3D >( new WGridRegular3D(
> > > dimX, dimY, dimZ, WGridTransformOrtho( getStandardTransform() ) ) );
> > >      boost::shared_ptr< WDataSet > myDataSet;
> > >      wlog::debug( "WReaderMy" ) << "Load as WDataSetScalar";
> > >      myDataSet = boost::shared_ptr< WDataSet >( new WDataSetScalar(  
> > > myValueSet, myGrid ) );
> > >      myDataSet->setFilename( m_fname );
> > >      m_ifs->close();
> > >      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/
> > 
> 






More information about the OpenWalnut-Dev mailing list