]> Creatis software - creaMaracasVisu.git/blobdiff - lib/maracasVisuLib/src/interface/wxWindows/widgets/imageUndoRedo/imageUndoRedo.cxx
#3482 Bug Manual Paint - MacOs and UChar images
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / imageUndoRedo / imageUndoRedo.cxx
index cba183cac36e253477109ac70bcdc0734dc50be8..0d650a7df91ac84f465cedb3c855ef2d8182f0e2 100755 (executable)
@@ -86,9 +86,9 @@ void ImageUndoRedo::SetImage( VTKImageDataPointerType image )
 void ImageUndoRedo::SetURImages( ImageMManagerType* imMManager )
 {
        ImageMManagerType* newImageManager = new ImageMManagerType( imMManager );
-       if( newImageManager->ValidateRegion( ) )
+       if( newImageManager->ValidateRegion() )
        {
-               RegionSType region = newImageManager->GetModifiedRegion( );
+               RegionSType             region  = newImageManager->GetModifiedRegion( );
                VTKImageDataPointerType imgUndo = this->GetImageRegion( region,this->m_UndoImage );
                VTKImageDataPointerType imgRedo = this->GetImageRegion( region,this->m_CurrentImage );
                this->m_ImagesDeque->AddImagesToURContainer( imgUndo, imgRedo,newImageManager );
@@ -164,7 +164,9 @@ void ImageUndoRedo::DrawUR( ImageInfoUR* imageInfo, const bool& undo )
        {
                int *dim                        = img->GetDimensions( );        
                int sizeXImageIn        = dim[ 0 ];
-               size_t linesize         = sizeXImageIn * sizeof(unsigned short);
+//EED         size_t linesize     = sizeXImageIn * sizeof(unsigned short);
+        
+        size_t linesize     = sizeXImageIn * img->GetScalarSize();
                for( int j = region.minY, y = 0; j <= region.maxY; j++, y++ )
                {
                        for( int k = region.minZ, z = 0; k <= region.maxZ; k++, z++ )