From 88ff072091bbb421c00b4c161b8b6d20933283c3 Mon Sep 17 00:00:00 2001
From: Antoine Cribellier <antoine.cribellier@wur.nl>
Date: Mon, 4 Sep 2023 14:46:54 +0200
Subject: [PATCH] Added dynamic crop parameter in yaml file

---
 .../mosquito_escapes/preprocessing_settings-sample_binned.yaml | 1 +
 data/mosquito_escapes/preprocessing_settings-selection.yaml    | 3 ++-
 processes.yaml                                                 | 1 +
 tests/test_process_batch.py                                    | 3 ++-
 4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/data/mosquito_escapes/preprocessing_settings-sample_binned.yaml b/data/mosquito_escapes/preprocessing_settings-sample_binned.yaml
index 308f210..ef570e6 100755
--- a/data/mosquito_escapes/preprocessing_settings-sample_binned.yaml
+++ b/data/mosquito_escapes/preprocessing_settings-sample_binned.yaml
@@ -40,6 +40,7 @@ protocol:
   4:
     fn: crop
     kwargs:
+      dynamic_crop: true
       delete_previous: true
       from_fn_name: sample
       from_tracks: true
diff --git a/data/mosquito_escapes/preprocessing_settings-selection.yaml b/data/mosquito_escapes/preprocessing_settings-selection.yaml
index dfe42bf..11f9e94 100755
--- a/data/mosquito_escapes/preprocessing_settings-selection.yaml
+++ b/data/mosquito_escapes/preprocessing_settings-selection.yaml
@@ -36,7 +36,8 @@ protocol:
   3:
     fn: crop
     kwargs:
-      from_tracks: True
+      dynamic_crop: true
+      from_tracks: true
       delete_previous: true
       from_fn_name: sample
       height_crop: 200
diff --git a/processes.yaml b/processes.yaml
index b861117..7c2149d 100755
--- a/processes.yaml
+++ b/processes.yaml
@@ -16,6 +16,7 @@
 4:
   fn: crop
   kwargs:
+    dynamic_crop: true
     delete_previous: true
     from_fn_name: sample
     height_crop: 200
diff --git a/tests/test_process_batch.py b/tests/test_process_batch.py
index 9e1b5c4..0be831c 100755
--- a/tests/test_process_batch.py
+++ b/tests/test_process_batch.py
@@ -196,6 +196,8 @@ def test_batch_processing_dlc_analysis() -> None:
     img_process.analyse_dlc(dlc_cfg_path, shuffle, 0, 5, model_name, save_avi=True,
                             rec_names_to_process=rec_names_to_process, from_fn_name='save_avi', delete_previous=True)
 
+    # TODO! Make a simple example that doesn't need a Deeplabcut network
+
     # ------------------------------------------------------------------------------------------------------------------
     # Load (+ filtering and unscrambling) 2d coords from DLC
     # + Reverse processes (un-stitch, rotate back, un-crop)
@@ -203,7 +205,6 @@ def test_batch_processing_dlc_analysis() -> None:
     img_process.load_dlc(model_name, 'skeleton', dlt_path,
                          rec_names_to_process=rec_names_to_process, from_fn_name='analyse_dlc', show_plot=show_plot)
 
-    # TODO i,g process:recon"ddldc
 
 def test_batch_processing_fit_skeleton() -> None:
     """
-- 
GitLab