Commit 4cd7499b authored by David Rohr's avatar David Rohr
Browse files

fix compilation problem after merging branches

parent 8639adb7
......@@ -41,11 +41,11 @@ int bioem_RefMap::readRefMaps(bioem_param& param)
if(readMultMRC)
{
ifstream input(filemap);
ifstream input(param.filemap);
if (!input.good())
{
cout << "Failed to open file contaning MRC names: " << filemap << "\n";
cout << "Failed to open file contaning MRC names: " << param.filemap << "\n";
exit(0);
}
......@@ -69,18 +69,19 @@ int bioem_RefMap::readRefMaps(bioem_param& param)
indifile = mapname;
//Reading Multiple MRC
read_MRC(indifile,param);
}
for(int i=0;i<3;i++)mapname[i] = 'X';
for(int i=3;i<100;i++)mapname[i] = {0};
}
cout << "\n+++++++++++++++++++++++++++++++++++++++++++ \n";
cout << "Particle Maps read from MULTIPLE MRC Files in: " << filemap << "\n" ;
} else {
read_MRC(filemap,param);
cout << "Particle Maps read from MULTIPLE MRC Files in: " << param.filemap << "\n" ;
}
else
{
read_MRC(param.filemap,param);
cout << "\n++++++++++++++++++++++++++++++++++++++++++ \n";
cout << "Particle Maps read from ONE MRC File: " << filemap << "\n" ;
cout << "Particle Maps read from ONE MRC File: " << param.filemap << "\n" ;
}
}
else
......@@ -275,7 +276,7 @@ int bioem_RefMap::read_MRC(const char* filename,bioem_param& param)
float xlen, ylen, zlen;
int mode, ncstart, nrstart, nsstart, ispg, nsymbt, lskflg;
float a_tmp, b_tmp, g_tmp;
int mx, my, mz,mapc, mapr, maps;
int mx, my, mz,mapc, mapr, maps_local;
float dmin, dmax, dmean;
int n_range_viol0, n_range_viol1;
......@@ -319,7 +320,7 @@ int bioem_RefMap::read_MRC(const char* filename,bioem_param& param)
header_ok *= read_float(&g_tmp,fin,swap);
header_ok *= read_int(&mapc,fin,swap);
header_ok *= read_int(&mapr,fin,swap);
header_ok *= read_int(&maps,fin,swap);
header_ok *= read_int(&maps_local,fin,swap);
header_ok *= read_float(&dmin,fin,swap);
header_ok *= read_float(&dmax,fin,swap);
header_ok *= read_float(&dmean,fin,swap);
......@@ -347,7 +348,7 @@ int bioem_RefMap::read_MRC(const char* filename,bioem_param& param)
printf(" Gamma = %8.3f (unit cell angle)\n",g_tmp);
printf(" MAPC = %8d (columns axis: 1=X,2=Y,3=Z)\n",mapc);
printf(" MAPR = %8d (rows axis: 1=X,2=Y,3=Z)\n",mapr);
printf(" MAPS = %8d (sections axis: 1=X,2=Y,3=Z)\n",maps);
printf(" MAPS = %8d (sections axis: 1=X,2=Y,3=Z)\n",maps_local);
printf(" DMIN = %8.3f (minimum density value - ignored)\n",dmin);
printf(" DMAX = %8.3f (maximum density value - ignored)\n",dmax);
printf(" DMEAN = %8.3f (mean density value - ignored)\n",dmean);
......@@ -372,7 +373,8 @@ int bioem_RefMap::read_MRC(const char* filename,bioem_param& param)
cout << "Currently mode 2 is the only one allowed" << "\n";
exit(1);
} else
}
else
{
rewind (fin);
for (count=0; count<256; ++count) if (read_float_empty(fin)==0) {
......@@ -392,11 +394,14 @@ int bioem_RefMap::read_MRC(const char* filename,bioem_param& param)
for ( int j = 0 ; j < nr ; j ++ )
for ( int i = 0 ; i < nc ; i ++ )
{
if (read_float(&currfloat,fin,swap)==0) {
if (read_float(&currfloat,fin,swap)==0)
{
cout << "ERROR Converting Data: " << filename;
exit(1);
} else {
Ref[nmap+ntotRefMap].points[i][j] = currfloat;
}
else
{
maps[(nmap + ntotRefMap) * refMapSize + i * numPixels + j] = (myfloat_t) currfloat;
st += currfloat;
st2 += currfloat*currfloat;
}
......@@ -404,10 +409,10 @@ int bioem_RefMap::read_MRC(const char* filename,bioem_param& param)
//Normaling maps to zero mean and unit standard deviation
st /= float(nr*nc);
st2 = sqrt(st2/float(nr*nc)-st*st);
st2 = sqrt(st2 / float(nr * nc) - st * st);
for ( int j = 0 ; j < nr ; j ++ ) for ( int i = 0 ; i < nc ; i ++ ){
Ref[nmap+ntotRefMap].points[i][j] = Ref[nmap+ntotRefMap].points[i][j]/st2 - st/st2;
// if(nmap+ntotRefMap==300)cout << i << " " << j << " " << nmap+ntotRefMap << " " << Ref[nmap+ntotRefMap].points[i][j] << "\n";
maps[(nmap + ntotRefMap) * refMapSize + i * numPixels + j] = maps[(nmap + ntotRefMap) * refMapSize + i * numPixels + j] / st2 - st/st2;
//if(nmap+ntotRefMap==300) cout << i << " " << j << " " << nmap+ntotRefMap << " " << Ref[nmap+ntotRefMap].points[i][j] << "\n";
}
}
ntotRefMap += ns ;
......@@ -470,7 +475,7 @@ int bioem_RefMap::test_mrc (const char *vol_file, int swap) {
int mode, ncstart, nrstart, nsstart;
float xlen, ylen, zlen;
int i, header_ok = 1, n_range_viols = 0;
int mapc, mapr, maps;
int mapc, mapr, maps_local;
float alpha, beta, gamma;
float dmin, dmax, dmean, dummy, xorigin, yorigin, zorigin;
......@@ -499,7 +504,7 @@ int bioem_RefMap::test_mrc (const char *vol_file, int swap) {
header_ok *= read_float(&gamma,fin,swap);
header_ok *= read_int(&mapc,fin,swap);
header_ok *= read_int(&mapr,fin,swap);
header_ok *= read_int(&maps,fin,swap);
header_ok *= read_int(&maps_local,fin,swap);
header_ok *= read_float(&dmin,fin,swap);
header_ok *= read_float(&dmax,fin,swap);
header_ok *= read_float(&dmean,fin,swap);
......
......@@ -119,7 +119,7 @@ int bioem_model::readModel()
FILE *file = fopen ( filemodel , "r" );
if (file == NULL)
{
cout << "Error opening file " << filemode, << "\n";
cout << "Error opening file " << filemodel << "\n";
exit(1);
}
while ( fgets ( line, sizeof line, file ) != NULL )
......
Markdown is supported
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