From e88f7c5a3a30fa63f1b16f061475a83f41ef4f17 Mon Sep 17 00:00:00 2001
From: Huabin Zhou <huabin.zhou@utsouthwestern.edu>
Date: Mon, 24 Mar 2025 10:37:10 -0500
Subject: [PATCH] Fixt the tomogram contrast config

---
 src/file_handler.py     | 1 +
 test/s68/catm/config.py | 2 +-
 test/s68/tm/config.py   | 1 +
 3 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/file_handler.py b/src/file_handler.py
index 16b7da6..6441edb 100644
--- a/src/file_handler.py
+++ b/src/file_handler.py
@@ -166,6 +166,7 @@ def parse_input():
     tomogram = read_mrc(user_inputs["tomogram"])
     if not user_inputs['black_on_white']:
         tomogram = -tomogram
+        print("Inverted the tomogram contrast to match template.")
     dims = tomogram.shape
     templates = [read_mrc_permissive(template) for template in user_inputs["templates"]]
     if user_inputs["masks"]:
diff --git a/test/s68/catm/config.py b/test/s68/catm/config.py
index f362bdb..843fceb 100644
--- a/test/s68/catm/config.py
+++ b/test/s68/catm/config.py
@@ -19,7 +19,7 @@ tomoID = split_path[-2]
 prefix = tomoID + ".test1.catm"
 input_folder = "inputs/"
 tomogram = input_folder + tomoID + ".test1.lps25.mrc"
-
+black_on_white = 1 # The contrast of tomogram, 0 if the particle has white contrast (positive values)
 templates = [input_folder + "mono-8Apx-lps30-box30-rot12-core.mrc"]
 contour_level = [0.2]
 #  Masks are required to be the same shape as the templates
diff --git a/test/s68/tm/config.py b/test/s68/tm/config.py
index 2fa7604..046548b 100644
--- a/test/s68/tm/config.py
+++ b/test/s68/tm/config.py
@@ -19,6 +19,7 @@ tomoID = split_path[-2]
 prefix = tomoID + ".test1"
 input_folder = "inputs/"
 tomogram = input_folder + tomoID + ".test1.lps25.mrc"
+black_on_white = 1 # The contrast of tomogram, 0 if the particle has white contrast (positive values)
 
 templates = [input_folder + "mono-8Apx-lps30-box30-rot12-core.mrc"]
 contour_level = [0.2]
-- 
GitLab