Skip to content
Snippets Groups Projects
Commit 7003049f authored by Kai Schleicher's avatar Kai Schleicher
Browse files

fix bug that expected a certain channel sequence

changed result table column and file naming accordingly
parent 0432dccf
Branches fix-path-handling
No related tags found
No related merge requests found
......@@ -409,7 +409,7 @@ all_fiber_subsets =[ [], [], [] ]
for index, fiber_channel in enumerate(all_fiber_channels):
if fiber_channel > 0:
preset_results_column( rt, "channel " + str(fiber_channel) + " positive (" + roi_colors[fiber_channel-1] + ")", "NO" )
preset_results_column( rt, "channel " + str(fiber_channel) + " positive (" + roi_colors[index] + ")", "NO" )
if all_min_fiber_intensities[index] == 0:
all_min_fiber_intensities[index] = get_threshold_from_method(raw, fiber_channel, "Mean")[0]
IJ.log( "fiber channel " + str(fiber_channel) + " intensity threshold: " + str(all_min_fiber_intensities[index]) )
......@@ -418,7 +418,7 @@ for index, fiber_channel in enumerate(all_fiber_channels):
if len(positive_fibers) > 0:
change_subset_roi_color(rm, positive_fibers, roi_colors[index])
save_selected_rois( rm, positive_fibers, output_dir + "/" + raw_image_title + "_positive_fiber_rois_c" + str( fiber_channel ) + ".zip")
add_results( rt, "channel " + str(fiber_channel) + " positive (" + roi_colors[fiber_channel-1] + ")", positive_fibers, "YES")
add_results( rt, "channel " + str(fiber_channel) + " positive (" + roi_colors[index] + ")", positive_fibers, "YES")
# single positive
positive_c1 = all_fiber_subsets[0]
......@@ -433,28 +433,28 @@ positive_c1_c2_c3 = list( set(positive_c1_c2).intersection(all_fiber_subsets[2])
# update ROI color & results table for double and triple positives
if len(positive_c1_c2) > 0:
preset_results_column( rt, "channel 1,2 positive (magenta)", "NO" )
preset_results_column( rt, "channel " + str(fiber_channel_1) + "," + str(fiber_channel_2) + " positive (magenta)", "NO" )
change_subset_roi_color(rm, positive_c1_c2, "magenta")
save_selected_rois( rm, positive_c1_c2, output_dir + "/" + raw_image_title + "_positive_fiber_rois_c1_c2.zip")
add_results( rt, "channel 1,2 positive (magenta)", positive_c1_c2, "YES")
save_selected_rois( rm, positive_c1_c2, output_dir + "/" + raw_image_title + "_positive_fiber_rois_c" + str(fiber_channel_1) + "_c" + str(fiber_channel_2) + ".zip")
add_results( rt, "channel " + str(fiber_channel_1) + "," + str(fiber_channel_2) + " positive (magenta)", positive_c1_c2, "YES")
if len(positive_c1_c3) > 0:
preset_results_column( rt, "channel 1,3 positive (yellow)", "NO" )
preset_results_column( rt, "channel " + str(fiber_channel_1) + "," + str(fiber_channel_3) + " positive (yellow)", "NO" )
change_subset_roi_color(rm, positive_c1_c3, "yellow")
save_selected_rois( rm, positive_c1_c3, output_dir + "/" + raw_image_title + "_positive_fiber_rois_c1_c3.zip")
add_results( rt, "channel 1,3 positive (yellow)", positive_c1_c3, "YES")
save_selected_rois( rm, positive_c1_c3, output_dir + "/" + raw_image_title + "_positive_fiber_rois_c" + str(fiber_channel_1) + "_c" + str(fiber_channel_3) + ".zip")
add_results( rt, "channel " + str(fiber_channel_1) + "," + str(fiber_channel_3) + " positive (yellow)", positive_c1_c3, "YES")
if len(positive_c2_c3) > 0:
preset_results_column( rt, "channel 2,3 positive (cyan)", "NO" )
preset_results_column( rt, "channel " + str(fiber_channel_2) + "," + str(fiber_channel_3) + " positive (cyan)", "NO" )
change_subset_roi_color(rm, positive_c2_c3, "cyan")
save_selected_rois( rm, positive_c2_c3, output_dir + "/" + raw_image_title + "_positive_fiber_rois_c2_c3.zip")
add_results( rt, "channel 2,3 positive (cyan)", positive_c2_c3, "YES")
save_selected_rois( rm, positive_c2_c3, output_dir + "/" + raw_image_title + "_positive_fiber_rois_c" + str(fiber_channel_2) + "_c" + str(fiber_channel_3) + ".zip")
add_results( rt, "channel " + str(fiber_channel_2) + "," + str(fiber_channel_3) + " positive (cyan)", positive_c2_c3, "YES")
if len(positive_c1_c2_c3) > 0:
preset_results_column( rt, "channel 1,2,3 positive (white)", "NO" )
preset_results_column( rt, "channel " + str(fiber_channel_1) + "," + str(fiber_channel_2) + "," + str(fiber_channel_3) + " positive(white)", "NO" )
change_subset_roi_color(rm, positive_c1_c2_c3, "white")
save_selected_rois( rm, positive_c1_c2_c3, output_dir + "/" + raw_image_title + "_positive_fiber_rois_c1_c2_c3.zip")
add_results( rt, "channel 1,2,3 positive (white)", positive_c1_c2_c3, "YES")
save_selected_rois( rm, positive_c1_c2_c3, output_dir + "/" + raw_image_title + "_positive_fiber_rois_c" + str(fiber_channel_1) + "_c" + str(fiber_channel_2) + "_c" + str(fiber_channel_3) + ".zip")
add_results( rt, "channel " + str(fiber_channel_1) + "," + str(fiber_channel_2) + "," + str(fiber_channel_3) + " positive(white)", positive_c1_c2_c3, "YES")
# save all results together
save_all_rois( rm, output_dir + "/" + raw_image_title + "_all_fiber_type_rois_color-coded.zip" )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment