-
Notifications
You must be signed in to change notification settings - Fork 146
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e483e8
commit 388ea40
Showing
9 changed files
with
286 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"id": "e741f10a", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from simba.utils.read_write import find_files_of_filetypes_in_directory\n", | ||
"from simba.utils.enums import Options\n", | ||
"from simba.roi_tools.ROI_define import ROI_definitions\n", | ||
"from simba.roi_tools.ROI_multiply import multiply_ROIs" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"id": "cd6d77d7", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# DEFINE THE PATH TO THE SIMBA PROJECT CONFIG, AND THE PATH TO THE DIRECTORY IN SIMBA WHERE THE VIDEOS ARE STORED.\n", | ||
"PROJECT_CONFIG_PATH = r\"C:\\troubleshooting\\mitra\\project_folder\\project_config.ini\"\n", | ||
"VIDEO_DIR_PATH = r'C:\\troubleshooting\\mitra\\project_folder\\videos'" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"id": "6efef9a3", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#CREATE A LIST OF PATHS TO THE VIDEO FILES THAT EXIST IN THE SIMBA PROJECT\n", | ||
"video_file_paths = find_files_of_filetypes_in_directory(directory=VIDEO_DIR_PATH, extensions=Options.ALL_VIDEO_FORMAT_OPTIONS.value)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"id": "c9d03e3c", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"['C:\\\\troubleshooting\\\\mitra\\\\project_folder\\\\videos\\\\501_MA142_Gi_CNO_0514.mp4', 'C:\\\\troubleshooting\\\\mitra\\\\project_folder\\\\videos\\\\501_MA142_Gi_CNO_0516.mp4', 'C:\\\\troubleshooting\\\\mitra\\\\project_folder\\\\videos\\\\501_MA142_Gi_CNO_0521.mp4', 'C:\\\\troubleshooting\\\\mitra\\\\project_folder\\\\videos\\\\501_MA142_Gi_DCZ_0603.mp4', 'C:\\\\troubleshooting\\\\mitra\\\\project_folder\\\\videos\\\\501_MA142_Gi_Saline_0513.mp4']\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#WE CAN PRINT IT OUT THE FIRST 5 VIDEO PATHS IN THIS LIST TO SEE HOW IT LOOKS.\n", | ||
"print(video_file_paths[:5])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"id": "aa4ad831", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"C:\\Users\\sroni\\.conda\\envs\\simba\\lib\\_collections_abc.py:666: MatplotlibDeprecationWarning:\n", | ||
"\n", | ||
"The global colormaps dictionary is no longer considered public API.\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"SIMBA COMPLETE: ROI definitions saved for video: 501_MA142_Gi_CNO_0514 \tcomplete\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# WE RUN THE ROI DRAWING INTERFACE AND DRAW ROIs ON THE FIRST VIDEO IN THE LIST.\n", | ||
"# ONCE THE ROIs ARE DRAWN ON THIS VIDEO, REMEMBER TO CLICK \"SAVE ROI DATA\", AND THEN CLOSE ALL OPEN THE INTERFACE WINDOWS.\n", | ||
"_ = ROI_definitions(config_path=PROJECT_CONFIG_PATH, video_path=video_file_paths[0])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"id": "bc51d1d4", | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"SIMBA COMPLETE: ROIs for 501_MA142_Gi_CNO_0514 applied to a further 99 videos (Duplicated rectangles count: 1, circles: 0, polygons: 0). \tcomplete\n", | ||
"\n", | ||
"Next, click on \"draw\" to modify ROI location(s) or click on \"reset\" to remove ROI drawing(s)\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"#NEXT, WE MULTIPLY ALL THE ROIs ON THE FIRST VIDEO ON THE LIST ON ALL OTHE VIDEOS IN THE SIMBA PROJECT (THIS PROJECT CONTAINS A TOTAL OF 100 VIDEOS)\n", | ||
"multiply_ROIs(config_path=PROJECT_CONFIG_PATH, filename=video_file_paths[0])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 14, | ||
"id": "a065f176", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"#FINALLY, WE START TO ITERATE OVER ALL OTHER VIDEOS IN THE PROJECT (OMITTING THE FIRST VIDEO), AND CORRECT THE ROIs.\n", | ||
"# I DON'T HAVE A GOOD WAY OF AUTMATICALLY OPENING THE NEXT VIDEO ONCE A VIDEO IS CLOSED AT THE MOMENT, \n", | ||
"# SO WILL HAVE TO MANUALLY CHANGE `video_file_paths[1]` TO `video_file_paths[2]` etc.\n", | ||
"_ = ROI_definitions(config_path=PROJECT_CONFIG_PATH, video_path=video_file_paths[1])" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"id": "8b2a1d89", | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3", | ||
"version": "3.6.13" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 5 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ Miscellaneous | |
|
||
nb/import_sleap_h5 | ||
nb/multiclass | ||
nb/define_rois | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ | |
# Setup configuration | ||
setuptools.setup( | ||
name="simba-uw-tf-dev", | ||
version="2.5.2", | ||
version="2.5.4", | ||
author="Simon Nilsson, Jia Jie Choong, Sophia Hwang", | ||
author_email="[email protected]", | ||
description="Toolkit for computer classification and analysis of behaviors in experimental animals", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.