From: machado Date: Wed, 13 May 2009 09:31:31 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: EED.02Oct2009~29 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=d90a85b95172ce5791bf701c8ad1e227f26c4b46;p=crea.git *** empty log message *** --- diff --git a/src/creaVtk.txx b/src/creaVtk.txx index bbebc1d..f0ea5be 100644 --- a/src/creaVtk.txx +++ b/src/creaVtk.txx @@ -22,7 +22,8 @@ namespace crea vtkImageData* CREA_EXPORT NewVtkImageDataFromRaw( T* data, int nx, int ny, - int nz) + int nz, + bool do_not_desalloc) { // std::cout << "NV "<::SizedName() << std::endl; @@ -67,8 +68,11 @@ namespace crea = dynamic_cast*>(array); array->SetNumberOfComponents( 1 ); size_t size = (long)nx*(long)ny*(long)nz; - // The last param of SetArray is set to 1 to keep the class from deleting the array when it cleans up or reallocates memory. - tarray->SetArray( data, size, 1 ); + // The last param of SetArray is set to 1 to keep the class from deleting the array + // when it cleans up or reallocates memory. + int dndesa = 0; + if (do_not_desalloc) dndesa = 1; + tarray->SetArray( data, size, dndesa ); image->GetPointData( )->SetScalars( tarray ); array->Delete( ); return image;