Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MPI-Dortmund
sphire
eman2mirror
Commits
0f7ec315
Commit
0f7ec315
authored
May 27, 2022
by
shadow_walker
Browse files
cleanup old
parent
260e342b
Changes
1
Hide whitespace changes
Inline
Side-by-side
libEM/io/mrcio.cpp
View file @
0f7ec315
...
...
@@ -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
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment