newImage->AllocateScalars();
newImage->Update();
pos = dimX*dimY*(long long)bbGetInputSlice()*dataSize;
-
-
-
#if defined(_WIN32)
if (_lseeki64( fd, pos, SEEK_SET ) < 0)
#else
if (lseek64(fd, pos, SEEK_SET) < 0)
#endif // defined(_WIN32)
-
{
printf("EED ReadMHDPlane::Read64lseek \n");
fprintf(stderr, "Failed seeking to %lld, %s\n", pos, strerror(errno));
}
} // if PLANE XY
- /*
if (bbGetInputDirectionPlane()=="XZ")
{
long long int j;
newImage->Update();
long long sizeBytesPlane = dimX*dimY*dataSize;
pos = dimX*(long long int)bbGetInputSlice()*dataSize;
- void *pImage = newImage->GetScalarPointer();
+ char *pImage = (char*)(newImage->GetScalarPointer());
for (j=0;j<dimZ;j++)
{
-printf("EED EED ReadMHDPlane::Read64lseek XZ j=%d \n", j);
+#if defined(_WIN32)
+ if (_lseeki64( fd, pos + j*sizeBytesPlane , SEEK_SET ) < 0)
+#else
if (lseek64(fd, pos + j*sizeBytesPlane , SEEK_SET) < 0)
+#endif // defined(_WIN32)
{
printf("EED ReadMHDPlane::Read64lseek \n");
fprintf(stderr, "Failed seeking to %lld, %s\n", pos, strerror(errno));
fprintf(stderr, "Failed reading: %s\n", strerror(errno));
exit(1);
}
- pImage=pImage+dimX*dataSize;
+ pImage = pImage+dimX*dataSize;
} // for j
} // if PLANE XZ
newImage->AllocateScalars();
newImage->Update();
long long sizeBytesPlane = dimX*dimY*dataSize;
-// pos = dimX*(long long int)bbGetInputSlice()*dataSize;
- void *pImage;
+ char *pImage;
for (j=0;j<dimZ;j++)
{
-printf("EED EED ReadMHDPlane::Read64lseek YZ i=%d j=%d \n", i,j);
for (i=0;i<dimY;i++)
{
pos = ((long long int)bbGetInputSlice() + i*dimX + j*dimX*dimY)*dataSize ;
- if (lseek64(fd, pos , SEEK_SET) < 0)
+#if defined(_WIN32)
+ if (_lseeki64( fd, pos , SEEK_SET ) < 0)
+#else
+ if (lseek64(fd, pos , SEEK_SET) < 0)
+#endif // defined(_WIN32)
{
printf("EED ReadMHDPlane::Read64lseek \n");
fprintf(stderr, "Failed seeking to %lld, %s\n", pos, strerror(errno));
exit(1);
}
- pImage=newImage->GetScalarPointer(i, j,0 );
+ pImage=(char*)(newImage->GetScalarPointer(i, j,0 ));
if ((ret = read(fd, pImage , dataSize)) < 0)
{
fprintf(stderr, "Failed reading: %s\n", strerror(errno));
}
} // for j
} // if PLANE YZ
- */
+
#if defined(_WIN32)
_close (fd);