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

Remove sum projection as data is a 2D MIP

parent 9a094bcc
No related branches found
No related tags found
1 merge request!2Initial commit
......@@ -776,16 +776,15 @@ results_table = ResultsTable()
for index, channel in enumerate(processing_channels):
channel = int(channel)
quality_threshold = float(quality_thresholds[index])
spots_channel = BFopen_image(path_to_image, channel, series_number) # can be a stack
spots_label_imp = run_trackmate_dog_spot_detector(spots_channel, quality_threshold) # spot detection is 3D
spots_channel = BFopen_image(path_to_image, channel, series_number)
spots_label_imp = run_trackmate_dog_spot_detector(spots_channel, quality_threshold)
save_image_as_IJtif(spots_label_imp, filename, "spots_ch" + str(channel), parent_dir)
save_labelimage_as_ijroiset(spots_label_imp, filename, "spots_ch" + str(channel), parent_dir)
spots_binary_imp = convert_labelimage_to_binary(spots_label_imp) # can be a stack
spots_binary_imp_sum_proj = ZProjector.run(spots_binary_imp, "sum") # if 2 (n) spots perfecly overlap in z, the pixel value will be 2 (n)
dapi_positive_spots_binary = ImageCalculator.run(spots_binary_imp_sum_proj, dapi_binary, "Multiply create")
dapi_negative_spots_binary = ImageCalculator.run(spots_binary_imp_sum_proj, dapi_positive_spots_binary, "Subtract create")
spots_binary_imp = convert_labelimage_to_binary(spots_label_imp)
dapi_positive_spots_binary = ImageCalculator.run(spots_binary_imp, dapi_binary, "Multiply create")
dapi_negative_spots_binary = ImageCalculator.run(spots_binary_imp, dapi_positive_spots_binary, "Subtract create")
n_spots_per_fiber = measure_intensity_sum(fibers_label_imp, spots_binary_imp_sum_proj)
n_spots_per_fiber = measure_intensity_sum(fibers_label_imp, spots_binary_imp)
n_dapi_positive_spots_per_fiber = measure_intensity_sum(fibers_label_imp, dapi_positive_spots_binary)
n_dapi_negative_spots_per_fiber = measure_intensity_sum(fibers_label_imp, dapi_negative_spots_binary)
......@@ -794,7 +793,7 @@ for index, channel in enumerate(processing_channels):
add_results_to_resultstable(results_table, "n spots channel " + str(channel), n_spots_per_fiber[1])
add_results_to_resultstable(results_table, "n spots dapi positive channel " + str(channel), n_dapi_positive_spots_per_fiber[1])
add_results_to_resultstable(results_table, "n spots dapi negative channel " + str(channel), n_dapi_negative_spots_per_fiber[1])
close_images([spots_channel, spots_label_imp, spots_binary_imp, spots_binary_imp_sum_proj, dapi_binary, dapi_positive_spots_binary, dapi_negative_spots_binary])
close_images([spots_channel, spots_label_imp, spots_binary_imp, spots_binary_imp, dapi_binary, dapi_positive_spots_binary, dapi_negative_spots_binary])
results_table.show("Spots")
save_results_table(results_table, filename, "Spots", parent_dir)
......
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