Commit 0f7ec315 authored by shadow_walker's avatar shadow_walker
Browse files

cleanup old

parent 260e342b
......@@ -1327,9 +1327,6 @@ int MrcIO::write_data(float *data, int image_index, const Region* area,
mrch.nz = 1;
}
// New way to write data which includes region writing.
// If it is tested to be OK, remove the old code in the
// #if 0 ... #endif block.
EMUtil::process_region_io(ptr_data, file, WRITE_ONLY, image_index,
mode_size, mrch.nx, mrch.ny, mrch.nz, area);
......@@ -1338,72 +1335,6 @@ int MrcIO::write_data(float *data, int image_index, const Region* area,
if (sdata) {delete [] sdata; sdata = NULL;}
if (usdata) {delete [] usdata; usdata = NULL;}
#if 0
int row_size = nx * get_mode_size(mrch.mode);
int sec_size = nx * ny;
unsigned char * cbuf = new unsigned char[row_size];
unsigned short * sbuf = (unsigned short *) cbuf;
for (int i = 0; i < nz; i++) {
int i2 = i * sec_size;
for (int j = 0; j < ny; j++) {
int k = i2 + j * nx;
void * pbuf = 0;
switch (mrch.mode) {
case MRC_UCHAR:
for (int l = 0; l < nx; l++) {
cbuf[l] = static_cast < unsigned char >(data[k + l]);
}
pbuf = cbuf;
fwrite(cbuf, row_size, 1, file);
break;
case MRC_SHORT:
case MRC_SHORT_COMPLEX:
for (int l = 0; l < nx; l++) {
sbuf[l] = static_cast < short >(data[k + l]);
}
pbuf = sbuf;
fwrite(sbuf, row_size, 1, file);
break;
case MRC_USHORT:
for (int l = 0; l < nx; l++) {
sbuf[l] = static_cast < unsigned short >(data[k + l]);
}
pbuf = sbuf;
fwrite(sbuf, row_size, 1, file);
break;
case MRC_FLOAT:
case MRC_FLOAT_COMPLEX:
pbuf = &data[k];
break;
}
if (pbuf) {
fwrite(pbuf, row_size, 1, file);
}
}
}
if (cbuf)
{
delete [] cbuf;
cbuf = NULL;
}
#endif
EXITFUNC;
return 0;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment