-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some fixes #317
base: master
Are you sure you want to change the base?
some fixes #317
Changes from 1 commit
163b6e1
914aef2
9559069
4b98366
1094983
c4ffdac
219f7cf
ec25329
b374433
29c3f10
8d4888c
b965472
6c6bc80
d7c31ff
0163e02
a43553b
0a54a82
e826fda
3899965
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ Multi-animals; 4 body-parts | |
Multi-animals; 7 body-parts | ||
Multi-animals; 8 body-parts | ||
3D tracking | ||
mouse_and_bug | ||
from_below | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree, my bad |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ | |
2 | ||
2 | ||
1 | ||
1 | ||
1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agree, my bad |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 👍🏻 I know in development this |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
__author__ = "Tzuk Polinsky" | ||
|
||
import glob | ||
import os | ||
|
||
import pandas | ||
|
||
from simba.mixins.config_reader import ConfigReader | ||
from simba.mixins.pop_up_mixin import PopUpMixin | ||
from simba.roi_tools.ROI_feature_analyzer import ROIFeatureCreator | ||
from simba.utils.errors import NoROIDataError | ||
|
||
|
||
class AppendBodyPartDirectionalityFeaturesPopUp(PopUpMixin, ConfigReader): | ||
def __init__(self, config_path: str): | ||
PopUpMixin.__init__(self, config_path=config_path, title="APPEND BODY PART DIRECTIONALITY FEATURES") | ||
ConfigReader.__init__(self, config_path=config_path) | ||
if not os.path.isfile(self.roi_coordinates_path): | ||
raise NoROIDataError( | ||
msg="SIMBA ERROR: No ROIs have been defined. Please define ROIs before appending ROI-based features" | ||
) | ||
self.create_choose_number_of_body_parts_directionality_frm( | ||
path_to_directionality_dir=self.body_part_directionality_df_dir, run_function=self.run | ||
) | ||
# self.main_frm.mainloop() | ||
|
||
def run(self): | ||
settings = {} | ||
settings["body_parts_directionality"] = {} | ||
for bp_cnt, bp_dropdown in self.bp_cnt_dropdown.items(): | ||
settings["body_parts_directionality"] = bp_dropdown.getChoices() | ||
directionality_data_path = os.path.join(self.body_part_directionality_df_dir, | ||
settings["body_parts_directionality"]) | ||
data_dic = {} | ||
for root, dirs, files in os.walk(directionality_data_path): | ||
for file in files: | ||
data = pandas.read_csv(os.path.join(root, file))["Directing_BOOL"] | ||
data_dic[file] = data | ||
files_found = glob.glob( | ||
self.outlier_corrected_dir + "/*." + self.file_type | ||
) | ||
concatenate_data = {} | ||
for file in files_found: | ||
data = pandas.read_csv(os.path.join(root, file)) | ||
c_data = pandas.concat([data, data_dic[file]]) | ||
concatenate_data[file] = c_data | ||
for file_name, data in concatenate_data.items(): | ||
save_path = os.path.join( | ||
self.features_dir, file_name + "." + self.file_type | ||
) | ||
data.to_csv(save_path) | ||
|
||
# roi_feature_creator = ROIFeatureCreator( | ||
# config_path=self.config_path, settings=settings | ||
# ) | ||
# roi_feature_creator.run() | ||
# roi_feature_creator.save() | ||
|
||
# _ = AppendROIFeaturesByBodyPartPopUp(config_path='/Users/simon/Desktop/envs/troubleshooting/two_animals_16bp_032023/project_folder/project_config.ini') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove these two lines and revert to original bp_names.csv otherwise others get to see your body-part configs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agree, my bad