]> Creatis software - creaVtk.git/commitdiff
#2711 creaVtk Feature New Normal - new Box ReadMHDPlane
authorEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 6 May 2016 13:24:09 +0000 (15:24 +0200)
committerEduardo DAVILA <eduardo.davila@creatis.insa-lyon.fr>
Fri, 6 May 2016 13:24:09 +0000 (15:24 +0200)
bbtk_creaVtk_PKG/src/bbcreaVtkReadMHDPlane.cxx

index d6818392ee6566160afc72b6f71da87257fe5e43..0c1833c49c57f72c1aae0040d75ad9199da2e834 100644 (file)
@@ -385,7 +385,7 @@ void ReadMHDPlane::copy_YZ_plane(int fd,vtkImageData *newImage,int slice,int iWi
                                exit(1);
                        }
 
-                       pImage=(char*)(newImage->GetScalarPointer(i, j,iWidth ));
+                       pImage=(char*)(newImage->GetScalarPointer(i, dimZ-1-j,iWidth ));
                        if ((ret = read(fd, pImage , dataSize)) < 0) 
                        {
                                fprintf(stderr, "Failed reading: %s\n", strerror(errno));
@@ -404,7 +404,7 @@ void ReadMHDPlane::copy_XZ_plane(int fd,vtkImageData *newImage,int slice,int iWi
        pos = dimX*(long long int)slice*dataSize;
        long long sizeBytesPlane = dimX*dimY*dataSize;
        char *pImage = (char*)( newImage->GetScalarPointer(0,0,iWidth) );
-       for (j=0;j<dimZ;j++)
+       for (j=dimZ-1;j>=0;j--)
        {
 #if defined(_WIN32)
                if (_lseeki64( fd, pos + j*sizeBytesPlane , SEEK_SET ) < 0)