Skip to content

Commit

Permalink
this is it
Browse files Browse the repository at this point in the history
  • Loading branch information
kapoorlab committed Sep 30, 2024
1 parent 76b156b commit 757243c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/napatrackmater/Trackvector.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
]


TRACK_TYPE_FEATURE = ["MSD"]
TRACK_TYPE_FEATURES = ["MSD"]
IDENTITY_FEATURES = ["Track ID", "t", "z", "y", "x", "Dividing", "Number_Dividing"]

STATUS_FEATURES = ["Dividing", "Number_Dividing"]
Expand Down Expand Up @@ -265,7 +265,9 @@ def _get_track_vector_xml_data(self):
)
self.basicsettings = self.xml_content.find("Settings").find("BasicSettings")
try:
self.detectorchannel = int(float(self.detectorsettings.get("TARGET_CHANNEL")))
self.detectorchannel = int(
float(self.detectorsettings.get("TARGET_CHANNEL"))
)
except TypeError:
self.detectorchannel = 1
self.tstart = int(float(self.basicsettings.get("tstart")))
Expand Down Expand Up @@ -370,7 +372,7 @@ def _compute_track_vectors(self):
cell_axis_z,
cell_axis_y,
cell_axis_x,
msd
msd,
]
+ (
[latent_features[i] for i in range(len(latent_features))]
Expand Down Expand Up @@ -4123,9 +4125,9 @@ def get_most_frequent_prediction(predictions):
final_predictions = shape_predictions + dynamic_predictions
most_frequent_prediction = get_most_frequent_prediction(final_predictions)
if most_frequent_prediction is not None:
most_predicted_class = class_map[int(most_frequent_prediction)]
most_predicted_class = class_map[int(most_frequent_prediction)]

return most_predicted_class
return most_predicted_class
else:
return "UnClassified"

Expand Down Expand Up @@ -4166,4 +4168,4 @@ def save_cell_type_predictions(

filename = os.path.join(save_dir, f"{save_name}.csv")
df.to_csv(filename, index=True)
print(f"Saved data for cell type {value} to {filename}")
print(f"Saved data for cell type {value} to {filename}")

0 comments on commit 757243c

Please sign in to comment.