preparation for 1.5.1

This commit is contained in:
2026-07-17 23:59:42 -07:00
parent 0680718398
commit 2b019c1bc0
11 changed files with 350 additions and 59 deletions
+12 -25
View File
@@ -40,12 +40,6 @@ PARAMETERIZED_INDEXES = {
"default": "hbo",
"type": str,
},
{
"key": "roi_config",
"label": "Location of the ROI config file",
"default": r"C:\Users\tyler\Desktop\research\flares\regions.json",
"type": str,
},
{
"key": "threshold_topo",
"label": "threshold_topo: TBD",
@@ -81,14 +75,14 @@ PARAMETERIZED_INDEXES = {
{
"key": "roi_a",
"label": "ROI A (e.g. contralateral region name from regions.json)",
"default": "",
"type": str,
"default": [],
"type": list,
},
{
"key": "roi_b",
"label": "ROI B (e.g. ipsilateral region name from regions.json)",
"default": "",
"type": str,
"default": [],
"type": list,
}
],
2: [
@@ -116,17 +110,11 @@ PARAMETERIZED_INDEXES = {
"default": "hbo",
"type": str,
},
{
"key": "roi_config",
"label": "Location of the ROI config file",
"default": r"C:\Users\tyler\Desktop\research\flares\regions.json",
"type": str,
},
{
"key": "contrast_name",
"label": "Name of the contrast to use",
"default": "",
"type": str,
"default": [],
"type": list,
},
],
}
@@ -148,7 +136,7 @@ DESCRIPTION = """0. Raw ROI Comparison (run_cross_group_second_level_analysis)
class CrossGroupStatsWidget(CrossGroupUIMixin, FlaresBaseWidget):
def __init__(self, haemo_dict, cha_dict, df_ind_dict, design_matrix_dict, contrast_results_dict, group_dict):
def __init__(self, haemo_dict, cha_dict, df_ind_dict, design_matrix_dict, contrast_results_dict, group_dict, json_location):
super().__init__("CrossGroupStats")
self.setWindowTitle(f"Cross-Group Stats Viewer - {APP_NAME.upper()}")
self.haemo_dict = haemo_dict
@@ -157,12 +145,13 @@ class CrossGroupStatsWidget(CrossGroupUIMixin, FlaresBaseWidget):
self.design_matrix_dict = design_matrix_dict
self.contrast_results_dict = contrast_results_dict
self.group_dict = group_dict
self.json_location = json_location
self.setup_cross_group_ui(["0 (Raw ROI Comparison)", "1 (Laterality Comparison)", "2 (Contrast Comparison)",], placeholder_text=DESCRIPTION)
def process_request(self):
request = self.get_common_request_data(PARAMETERIZED_INDEXES)
request = self.get_common_request_data(PARAMETERIZED_INDEXES, self.json_location, self.contrast_results_dict)
if request is None:
return
@@ -195,7 +184,6 @@ class CrossGroupStatsWidget(CrossGroupUIMixin, FlaresBaseWidget):
min_subjects = params.get("min_subjects", 3)
correction_method = params.get("correction_method", "fdr_bh")
target_chroma = params.get("target_chroma", "hbo")
roi_config = params.get("roi_config", r"C:\Users\tyler\Desktop\research\flares\regions.json")
threshold_topo = params.get("threshold_topo", False)
run_cross_group_second_level_analysis(
@@ -211,7 +199,7 @@ class CrossGroupStatsWidget(CrossGroupUIMixin, FlaresBaseWidget):
correction_method=correction_method,
target_chroma=target_chroma,
selected_event=selected_event,
roi_config=roi_config,
roi_config=self.json_location,
threshold_topo=threshold_topo # Shows the raw difference map (Unthresholded)
)
elif idx == 1:
@@ -273,11 +261,10 @@ class CrossGroupStatsWidget(CrossGroupUIMixin, FlaresBaseWidget):
min_subjects = params.get("min_subjects", 3)
correction_method = params.get("correction_method", "fdr_bh")
target_chroma = params.get("target_chroma", "hbo")
roi_config = params.get("roi_config", r"C:\Users\tyler\Desktop\research\flares\regions.json")
contrast_name = params.get("contrast_name", "")
if not contrast_name:
print("A contrast name must be specified (e.g. '2.0_vs_3.0').")
print("A contrast name must be specified.")
continue
# Build each group's channel-level contrast dataframe
@@ -311,7 +298,7 @@ class CrossGroupStatsWidget(CrossGroupUIMixin, FlaresBaseWidget):
df_contrasts_a=df_contrasts_a,
df_contrasts_b=df_contrasts_b,
contrast_name=contrast_name,
roi_json_path=roi_config,
roi_json_path=self.json_location,
group_a_name=self.group_a_dropdown.currentText(),
group_b_name=self.group_b_dropdown.currentText(),
target_chroma=target_chroma,
+2 -2
View File
@@ -271,7 +271,7 @@ class InterGroupStatsWidget(InterGroupUIMixin, FlaresBaseWidget):
print("Both ROI A and ROI B must be specified.")
continue
print(min_subjects)
run_roi_paired_contrast_analysis(
df_roi_all=df_group,
roi_pairs=(roi_a, roi_b),
@@ -290,7 +290,7 @@ class InterGroupStatsWidget(InterGroupUIMixin, FlaresBaseWidget):
min_subjects = params.get("min_subjects", 5)
correction_method = params.get("correction_method", "fdr_bh")
target_chroma = params.get("target_chroma", "hbo")
contrast_name = params.get("contrast_name", "2.0_vs_3.0")
contrast_name = params.get("contrast_name", "")
weighted = params.get("weighted", True)
graph_bounds = params.get("graph_bounds", 0.0)