added target background for uct

This commit is contained in:
James E McClure 2018-06-06 21:44:37 -04:00
parent e0d1a66982
commit 4aec20b8df
2 changed files with 20 additions and 10 deletions

View File

@ -6,15 +6,17 @@ Domain {
BC = 0 // Boundary condition type
}
uCT {
InputFile = "MG_dryrecon.volume"
rough_cutoff = 0.0
lamda = 0.5
nlm_sigsq = 0.25
InputFile = "MG_dryrecon.volume" // this is the name of the data to segment
target = -160 // this is the target value of the phase to segment
background = 160 // this is the background value for all other phases
rough_cutoff = 0.0 // step 1 -- rough thresholding
lamda = 0.5 // step 2 -- apply some smoothing
nlm_sigsq = 0.25 // step 3 -- apply non-local means
nlm_depth = 3
center_x = 960
center_x = 600
center_y = 960
center_z = 600
radius = 750
center_z = 960
cylinder_radius = 700
}
Analysis {
}

View File

@ -70,7 +70,9 @@ int main(int argc, char **argv)
int nprocy = nproc[1];
int nprocz = nproc[2];
auto InputFile=uct_db->getScalar<std::string>( "InputFile" );
auto InputFile=uct_db->getScalar<std::string>( "InputFile" );
auto target=uct_db->getScalar<int>("target");
auto background=uct_db->getScalar<int>("background");
auto rough_cutoff=uct_db->getScalar<float>( "rough_cutoff" );
auto lamda=uct_db->getScalar<float>( "lamda" );
auto nlm_sigsq=uct_db->getScalar<float>( "nlm_sigsq" );
@ -210,7 +212,8 @@ int main(int argc, char **argv)
// Compute the means for the high/low regions
// (should use automated mixture model to approximate histograms)
float THRESHOLD = 0.05*maxReduce( Dm[0]->Comm, std::max( LOCVOL[0].max(), fabs(LOCVOL[0].min()) ) );
//float THRESHOLD = 0.05*maxReduce( Dm[0]->Comm, std::max( LOCVOL[0].max(), fabs(LOCVOL[0].min()) ) );
float THRESHOLD=0.5*float(target+background);
float mean_plus=0;
float mean_minus=0;
int count_plus=0;
@ -219,7 +222,12 @@ int main(int argc, char **argv)
for (int j=1;j<Ny[0]+1;j++) {
for (int i=1;i<Nx[0]+1;i++) {
if (MASK(i,j,k) > 0.f ){
auto tmp = LOCVOL[0](i,j,k);
auto tmp = LOCVOL[0](i,j,k);
if ((tmp-background)*(tmp-target) > 0){
// direction to background / target is the same
if (tmp-target > tmp-background) tmp=target;
else tmp=background;
}
if ( tmp > THRESHOLD ) {
mean_plus += tmp;
count_plus++;