From f316796e993ab851ce81fca11d35a8305a6734b1 Mon Sep 17 00:00:00 2001 From: Romain Bazile Date: Thu, 1 Jul 2021 15:55:56 +0200 Subject: [PATCH] Replace all references to PlanktoNScope by PlanktoScope --- .github/workflows/auto-label.yml | 4 +- README.md | 2 +- config.json | 2 +- docs/easy_install.md | 6 +- docs/edit_the_code.md | 2 +- docs/edit_this_doc.md | 4 +- flows/main.json | 61 ++---- morphocut/README.md | 221 --------------------- morphocut/morphocut.py | 169 ---------------- morphocut/morphocut_opencv.py | 181 ----------------- scripts/gallery/gallery.conf | 4 +- scripts/main.py | 16 +- scripts/planktoscope/imager/__init__.py | 4 +- scripts/planktoscope/imager/raspimjpeg.py | 4 +- scripts/planktoscope/segmenter/__init__.py | 7 +- scripts/planktoscope/segmenter/ecotaxa.py | 2 +- scripts/planktoscope/stepper.py | 10 +- scripts/raspimjpeg/raspimjpeg.conf | 8 +- 18 files changed, 50 insertions(+), 657 deletions(-) delete mode 100644 morphocut/README.md delete mode 100644 morphocut/morphocut.py delete mode 100644 morphocut/morphocut_opencv.py diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml index be00f51..b4709d7 100644 --- a/.github/workflows/auto-label.yml +++ b/.github/workflows/auto-label.yml @@ -19,7 +19,7 @@ jobs: contains(github.event.issue.labels.*.name, 'hardware') || contains(github.event.pull_request.labels.*.name, 'hardware') with: - project: 'https://github.com/PlanktonPlanet/PlanktonScope/projects/2' + project: 'https://github.com/PlanktonPlanet/PlanktoScope/projects/2' column_name: 'Bugs' - name: Assign issues and pull requests with `software` label to project `Sofware` @@ -28,5 +28,5 @@ jobs: contains(github.event.issue.labels.*.name, 'software') || contains(github.event.pull_request.labels.*.name, 'software') with: - project: 'https://github.com/PlanktonPlanet/PlanktonScope/projects/1' + project: 'https://github.com/PlanktonPlanet/PlanktoScope/projects/1' column_name: 'To Do' diff --git a/README.md b/README.md index 10cdb8a..b065f19 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ There are several ways to join the development effort, share your progress with We are using slack as a communication platform between interested parties. You can [request to join by filling this form](https://docs.google.com/forms/d/e/1FAIpQLSfcod-avpzWVmWj42_hW1v2mMSHm0DAGXHxVECFig2dnKHxGQ/viewform). -This repository is also a good way to get involved. Please fill in an issue if you witnessed a bug in the software or hardware. If you are able, you can also join the development effort. Look through the [issues opened](https://github.com/PlanktonPlanet/PlanktonScope/labels/good%20first%20issue) and choose one that piques your interest. Let us know you want to work on it in the comments, we may even be able to guide your beginnings around the code. +This repository is also a good way to get involved. Please fill in an issue if you witnessed a bug in the software or hardware. If you are able, you can also join the development effort. Look through the [issues opened](https://github.com/PlanktonPlanet/PlanktoScope/labels/good%20first%20issue) and choose one that piques your interest. Let us know you want to work on it in the comments, we may even be able to guide your beginnings around the code. # License: Our work is fully open source diff --git a/config.json b/config.json index 5a94001..3c562b3 100644 --- a/config.json +++ b/config.json @@ -6,7 +6,7 @@ "sample_sampling_gear": "net", "sample_gear_net_opening": 40, "acq_id": 1, - "acq_instrument": "PlanktonScope v2.2", + "acq_instrument": "PlanktoScope v2.2", "acq_celltype": 200, "acq_minimum_mesh": 10, "acq_maximum_mesh": 200, diff --git a/docs/easy_install.md b/docs/easy_install.md index 637807f..e325c64 100644 --- a/docs/easy_install.md +++ b/docs/easy_install.md @@ -1,4 +1,4 @@ -# PlanktonScope Simple Setup Guide +# PlanktoScope Simple Setup Guide ## Download the image @@ -19,7 +19,7 @@ Review your selections and click 'Flash!' to begin writing data to the SD card. ## Inserting the SD card Once flashing is over, you can unmount the SD card from the computer (usually done by right clicking on the card icon in the taskbar). -Insert now the card in the Raspberry installed in your PlanktonScope. +Insert now the card in the Raspberry installed in your PlanktoScope. ## Install a mDNS client @@ -33,4 +33,4 @@ To install the client, download the installer [here](https://download.info.apple ## Start playing! -Start up your PlanktonScope and connect to its WiFi network. You can now access the webpage at http://planktonscope.local:1880/ui to start using your machine! \ No newline at end of file +Start up your PlanktoScope and connect to its WiFi network. You can now access the webpage at http://planktoscope.local:1880/ui to start using your machine! \ No newline at end of file diff --git a/docs/edit_the_code.md b/docs/edit_the_code.md index 22a1a35..50b9f87 100644 --- a/docs/edit_the_code.md +++ b/docs/edit_the_code.md @@ -2,7 +2,7 @@ We are using the [Github Flow approach](https://docs.github.com/en/free-pro-team@latest/github/collaborating-with-issues-and-pull-requests) for our development efforts. -If you want to join us, have a look at the [currently opened issues](https://github.com/PlanktonPlanet/PlanktonScope/issues) and pick one where you feel like you can have an impact. Let us know you want to work it in the comments and get started. +If you want to join us, have a look at the [currently opened issues](https://github.com/PlanktonPlanet/PlanktoScope/issues) and pick one where you feel like you can have an impact. Let us know you want to work it in the comments and get started. For working on Node-Red, we recommend to install it directly on your development machine to allow for faster cycles of testing (and ease of use). But feel free to setup a Pi Zero as a portable and compact development environment! (One of us is using one configured as usb gadget to do so!) diff --git a/docs/edit_this_doc.md b/docs/edit_this_doc.md index d6b8b3a..8de3cee 100644 --- a/docs/edit_this_doc.md +++ b/docs/edit_this_doc.md @@ -2,7 +2,7 @@ This documentation is hosted by [ReadTheDocs.org](https://readthedocs.org/) at https://planktonscope.readthedocs.io/. -The source files are in the main [github repository](https://www.github.com/PlanktonPlanet/PlanktonScope), in the `docs` folder. +The source files are in the main [github repository](https://www.github.com/PlanktonPlanet/PlanktoScope), in the `docs` folder. They are simple [Markdown files](https://www.markdownguide.org/), that you can edit in any text editor of your choice. @@ -12,7 +12,7 @@ After installing mkdocs, you can use `mkdocs serve` in the main folder of this r If you want to include pictures and diagrams in the documentation, please set the pictures in a dedicated folder to the name of the page you are creating (for example, if your page is named `expert_setup.md`, please put all the related pictures in the `docs/expert_setup/` folder). Each picture should be named with a simple yet descriptive name, using jpg or png format if possible. Try to limit the size of the file by limiting the resolution to what is necessary for the picture to be clear on screen. -Contributions should be made by creating pull requests on [Github directly](https://github.com/PlanktonPlanet/PlanktonScope/pulls). +Contributions should be made by creating pull requests on [Github directly](https://github.com/PlanktonPlanet/PlanktoScope/pulls). ## Extensions available diff --git a/flows/main.json b/flows/main.json index 00ed232..63f0240 100644 --- a/flows/main.json +++ b/flows/main.json @@ -143,7 +143,6 @@ { "id": "833bc5bb.217ba8", "type": "ui_group", - "z": "", "name": "Preview", "tab": "181bb236.1e94be", "order": 1, @@ -190,7 +189,6 @@ { "id": "d9cd733b.ab73d", "type": "ui_tab", - "z": "", "name": "System Monitoring", "icon": "fa-thermometer-full", "order": 7, @@ -220,7 +218,6 @@ { "id": "64903b47.4034e4", "type": "ui_group", - "z": "", "name": "Navigation", "tab": "8d16beb8.9b3fb", "order": 3, @@ -241,7 +238,6 @@ { "id": "cc8bc4eb.651868", "type": "ui_base", - "z": "", "theme": { "name": "theme-dark", "lightTheme": { @@ -340,7 +336,6 @@ { "id": "36739a35.7cce36", "type": "ui_tab", - "z": "", "name": "Gallery", "icon": "fa-file-image-o", "order": 6, @@ -350,7 +345,6 @@ { "id": "c0ebfc57.42527", "type": "ui_group", - "z": "", "name": "Group 1", "tab": "36739a35.7cce36", "order": 1, @@ -361,7 +355,6 @@ { "id": "737ec584.2eea2c", "type": "ui_tab", - "z": "", "name": "Sample", "icon": "fa-eyedropper", "order": 2, @@ -381,7 +374,6 @@ { "id": "3e1ba03d.f01d8", "type": "ui_group", - "z": "", "name": "Sample Identification", "tab": "737ec584.2eea2c", "order": 1, @@ -422,7 +414,6 @@ { "id": "196518b2.4d53b7", "type": "ui_group", - "z": "", "name": "Group 5", "tab": "3a6bb13f.c9703e", "order": 5, @@ -443,7 +434,6 @@ { "id": "cef1e703.bcf3c8", "type": "ui_group", - "z": "", "name": "Sample Location", "tab": "737ec584.2eea2c", "order": 2, @@ -484,7 +474,6 @@ { "id": "7a0b4877.a5d268", "type": "ui_group", - "z": "", "name": "Navigation", "tab": "181bb236.1e94be", "order": 6, @@ -515,7 +504,6 @@ { "id": "b7919ae2.c01788", "type": "ui_group", - "z": "", "name": "Navigation", "tab": "c9194f02.9d5e9", "order": 6, @@ -526,7 +514,6 @@ { "id": "b5d61bc7.54fe48", "type": "ui_group", - "z": "", "name": "Statistics", "tab": "c9194f02.9d5e9", "order": 4, @@ -537,7 +524,6 @@ { "id": "1be83144.4fe4bf", "type": "ui_group", - "z": "", "name": "Danger Zone (DO NOT TOUCH HERE UNLESS YOU KNOW WHAT YOU ARE DOING)", "tab": "2489e51c.eed77a", "order": 2, @@ -548,7 +534,6 @@ { "id": "3ca00bf9.e5cac4", "type": "ui_group", - "z": "", "name": "Navigation", "tab": "d9cd733b.ab73d", "order": 7, @@ -610,7 +595,6 @@ { "id": "abeb6dad.635a2", "type": "ui_group", - "z": "", "name": "Control", "tab": "8d16beb8.9b3fb", "order": 1, @@ -621,7 +605,6 @@ { "id": "cf5d9f0e.d57e7", "type": "ui_group", - "z": "", "name": "Net Metadata", "tab": "737ec584.2eea2c", "order": 3, @@ -642,7 +625,6 @@ { "id": "70de8209.68416c", "type": "ui_group", - "z": "", "name": "Status", "tab": "c9194f02.9d5e9", "order": 5, @@ -653,7 +635,6 @@ { "id": "46be9c86.dea684", "type": "ui_group", - "z": "", "name": "Status", "tab": "8d16beb8.9b3fb", "order": 2, @@ -664,7 +645,6 @@ { "id": "8c38a81e.9897a8", "type": "ui_group", - "z": "", "name": "Camera Settings", "tab": "181bb236.1e94be", "order": 3, @@ -675,7 +655,6 @@ { "id": "52d1b77.28369c8", "type": "ui_group", - "z": "", "name": "USB Backup", "tab": "d9cd733b.ab73d", "order": 6, @@ -686,7 +665,6 @@ { "id": "a7d64879.38298", "type": "ui_group", - "z": "", "name": "Python Log", "tab": "2489e51c.eed77a", "order": 1, @@ -697,7 +675,6 @@ { "id": "9e409235.73cd7", "type": "ui_group", - "z": "", "name": "Add a new network", "tab": "1b49ae0f.602d6a", "order": 2, @@ -708,7 +685,6 @@ { "id": "919923a3.d10868", "type": "ui_group", - "z": "", "name": "Current Connection", "tab": "1b49ae0f.602d6a", "order": 1, @@ -719,7 +695,6 @@ { "id": "1b49ae0f.602d6a", "type": "ui_tab", - "z": "", "name": "Wifi", "icon": "wifi", "order": 8, @@ -729,7 +704,6 @@ { "id": "2489e51c.eed77a", "type": "ui_tab", - "z": "", "name": "Administration", "icon": "dashboard", "order": 9, @@ -739,7 +713,6 @@ { "id": "b0fb559a.6966a8", "type": "ui_tab", - "z": "", "name": "Hardware Settings", "icon": "fa-cogs", "disabled": false, @@ -775,7 +748,6 @@ { "id": "fc5e4e6f.5b1c8", "type": "ui_group", - "z": "", "name": "GPS Status", "tab": "737ec584.2eea2c", "order": 5, @@ -813,7 +785,6 @@ { "id": "f3ca28ef.4df0a8", "type": "ui_group", - "z": "", "name": "Shutdown", "tab": "3a6bb13f.c9703e", "order": 7, @@ -833,7 +804,6 @@ { "id": "cfe2288f.a8862", "type": "ui_group", - "z": "", "name": "GPS Status", "tab": "d9cd733b.ab73d", "order": 8, @@ -871,7 +841,6 @@ { "id": "cee2ca2f.3dfe18", "type": "ui_group", - "z": "", "name": "Default", "tab": "b0fb559a.6966a8", "order": 1, @@ -3404,7 +3373,7 @@ "type": "function", "z": "baa1e3d9.cb29d", "name": "Encapsulate config", - "func": "msg.payload = {\n\t\"action\": \"update_config\",\n\t\"config\": {\n \t\"description\": {\n \t\t\"sample_project\": \"Project's name\",\n \t\t\"sample_id\": \"Sample ID\",\n \t\t\"sample_uuid\": \"Sample UUID (Autogenerated)\",\n \t\t\"sample_ship\": \"Ship's name\",\n \t\t\"sample_operator\": \"Operator's name\",\n \t\t\"sample_sampling_gear\": \"Sampling gear used\",\n \t\t\"sample_concentrated_sample_volume\": \"Volume of concentrated sample, in mL\",\n \t\t\"sample_total_volume\": \"Total volume filtered by the net used, in L\",\n \t\t\"acq_id\": \"Acquisition ID\",\n \t\t\"acq_uuid\": \"Acquisition UUID (Autogenerated)\",\n \t\t\"acq_instrument\": \"Instrument type\",\n \t\t\"acq_instrument_id\": \"Instrument ID\",\n \t\t\"acq_celltype\": \"Flow cell dimension thickness, in µm\",\n \t\t\"acq_minimum_mesh\": \"Minimum filtration mesh size, in µm\",\n \t\t\"acq_maximum_mesh\": \"Maximum filtration mesh size, in µm\",\n \t\t\"acq_min_esd\": \"\",\n \t\t\"acq_max_esd\": \"\",\n \t\t\"acq_volume\": \"Pumped volume, in mL\",\n\t\t \"acq_imaged_volume\": \"Total imaged volume, in mL\",\n \t\t\"acq_magnification\": \"Optical magnification\",\n \t\t\"acq_fnumber_objective\": \"Focal length of the objective, in mm\",\n \t\t\"acq_camera_name\": \"Name of the camera used\",\n \t\t\"acq_nb_frame\": \"Number of picture taken\",\n \"acq_local_datetime\": \"Instrument local datetime\",\n \"acq_camera_resolution\": \"Resolution of the images\",\n \"acq_camera_iso\": \"ISO Number of the images\",\n \"acq_camera_shutter_speed\": \"Shutter speed of the images, in µs\",\n \"acq_software\": \"Software version number\",\n \t\t\"object_date\": \"Sample collection date (or beginning if using a net)\",\n \t\t\"object_time\": \"Sample collection time (or beginning if using a net)\",\n \t\t\"object_lat\": \"Sample collection latitude (or beginning if using a net)\",\n \t\t\"object_lon\": \"Sample collection longitude (or beginning if using a net)\",\n \t\t\"object_depth_min\": \"Sample collection minimal depth, in m\",\n \t\t\"object_depth_max\": \"Sample collection maximum depth, in m\",\n \t\t\"process_pixel\": \"Pixel imaging resolution, in µm/pixel\",\n \t\t\"process_id\": \"Segmentation ID\",\n \t\t\"process_uuid\": \"Segmentation UUID (Autogenerated)\",\n \t\t\"process_source\": \"Code source link of the executed code\",\n \t\t\"process_commit\": \"Version reference of the executed code\",\n \t\t\"sample_gear_net_opening\": \"Sample mouth opening dimension, in mm\",\n \t\t\"object_date_end\": \"Sample end collection date when using a net\",\n \t\t\"object_time_end\": \"Sample end collection time when using a net\",\n \t\t\"object_lat_end\": \"Sample end collection latitude when using a net\",\n \t\t\"object_lon_end\": \"Sample end collection longitude when using a net\",\n \t},\n\t\t\"sample_project\": global.get(\"sample_project\"),\n\t\t\"sample_id\": global.get(\"sample_project\") + \"_\" + global.get(\"sample_id\"),\n\t\t\"sample_ship\": global.get(\"sample_ship\"),\n\t\t\"sample_operator\": global.get(\"sample_operator\"),\n\t\t\"sample_sampling_gear\": global.get(\"sample_sampling_gear\"),\n\t\t\"sample_concentrated_sample_volume\": global.get(\"sample_concentrated_sample_volume\"),\n\n\t\t\"acq_id\": global.get(\"sample_project\") + \"_\" + global.get(\"sample_id\")+ \"_\" + global.get(\"acq_id\"),\n\t\t\"acq_instrument\": global.get(\"acq_instrument\"),\n\t\t\"acq_instrument_id\": global.get(\"acq_instrument_id\"),\n\t\t\"acq_celltype\": global.get(\"acq_celltype\"),\n\t\t\"acq_minimum_mesh\": global.get(\"acq_minimum_mesh\"),\n\t\t\"acq_maximum_mesh\": global.get(\"acq_maximum_mesh\"),\n\t\t\"acq_min_esd\": global.get(\"acq_min_esd\"),\n\t\t\"acq_max_esd\": global.get(\"acq_max_esd\"),\n\t\t\"acq_volume\": global.get(\"acq_volume\"),\n\t\t\"acq_imaged_volume\": global.get(\"acq_imaged_volume\"),\n\t\t\"acq_magnification\": global.get(\"magnification\"),\n\t\t\"acq_fnumber_objective\": global.get(\"acq_fnumber_objective\"),\n\t\t\"acq_camera\": global.get(\"acq_camera\"),\n\t\t\"acq_nb_frame\": global.get(\"nb_frame\"),\n\t\t\"acq_software\": global.get(\"acq_software\"),\n\n\t\t\"object_date\": global.get(\"object_date\"),\n\t\t\"object_time\": global.get(\"object_time\"),\n\t\t\"object_lat\": global.get(\"object_lat\"),\n\t\t\"object_lon\": global.get(\"object_lon\"),\n\t\t\"object_depth_min\": global.get(\"object_depth_min\"),\n\t\t\"object_depth_max\": global.get(\"object_depth_max\"),\n\n\t\t\"process_pixel\": global.get(\"process_pixel\"),\n\t\t\"process_id\": global.get(\"process_id\"),\n\t\t\"process_source\": \"https://www.github.com/PlanktonPlanet/PlanktonScope\",\n\t\t\"process_commit\": global.get(\"process_commit\")\n\t}\n};\n\nif (msg.payload.config.sample_sampling_gear.startsWith(\"net\")) {\n\tmsg.payload.config[\"sample_gear_net_opening\"] = global.get(\"sample_gear_net_opening\")\n\tmsg.payload.config[\"object_date_end\"] = global.get(\"object_date_end\")\n\tmsg.payload.config[\"object_time_end\"] = global.get(\"object_time_end\")\n\tmsg.payload.config[\"object_lat_end\"] = global.get(\"object_lat_end\")\n\tmsg.payload.config[\"object_lon_end\"] = global.get(\"object_lon_end\")\n\tmsg.payload.config[\"sample_total_volume\"] = global.get(\"sample_total_volume\")\n}\nreturn msg;", + "func": "msg.payload = {\n\t\"action\": \"update_config\",\n\t\"config\": {\n \t\"description\": {\n \t\t\"sample_project\": \"Project's name\",\n \t\t\"sample_id\": \"Sample ID\",\n \t\t\"sample_uuid\": \"Sample UUID (Autogenerated)\",\n \t\t\"sample_ship\": \"Ship's name\",\n \t\t\"sample_operator\": \"Operator's name\",\n \t\t\"sample_sampling_gear\": \"Sampling gear used\",\n \t\t\"sample_concentrated_sample_volume\": \"Volume of concentrated sample, in mL\",\n \t\t\"sample_total_volume\": \"Total volume filtered by the net used, in L\",\n \t\t\"acq_id\": \"Acquisition ID\",\n \t\t\"acq_uuid\": \"Acquisition UUID (Autogenerated)\",\n \t\t\"acq_instrument\": \"Instrument type\",\n \t\t\"acq_instrument_id\": \"Instrument ID\",\n \t\t\"acq_celltype\": \"Flow cell dimension thickness, in µm\",\n \t\t\"acq_minimum_mesh\": \"Minimum filtration mesh size, in µm\",\n \t\t\"acq_maximum_mesh\": \"Maximum filtration mesh size, in µm\",\n \t\t\"acq_min_esd\": \"\",\n \t\t\"acq_max_esd\": \"\",\n \t\t\"acq_volume\": \"Pumped volume, in mL\",\n\t\t \"acq_imaged_volume\": \"Total imaged volume, in mL\",\n \t\t\"acq_magnification\": \"Optical magnification\",\n \t\t\"acq_fnumber_objective\": \"Focal length of the objective, in mm\",\n \t\t\"acq_camera_name\": \"Name of the camera used\",\n \t\t\"acq_nb_frame\": \"Number of picture taken\",\n \"acq_local_datetime\": \"Instrument local datetime\",\n \"acq_camera_resolution\": \"Resolution of the images\",\n \"acq_camera_iso\": \"ISO Number of the images\",\n \"acq_camera_shutter_speed\": \"Shutter speed of the images, in µs\",\n \"acq_software\": \"Software version number\",\n \t\t\"object_date\": \"Sample collection date (or beginning if using a net)\",\n \t\t\"object_time\": \"Sample collection time (or beginning if using a net)\",\n \t\t\"object_lat\": \"Sample collection latitude (or beginning if using a net)\",\n \t\t\"object_lon\": \"Sample collection longitude (or beginning if using a net)\",\n \t\t\"object_depth_min\": \"Sample collection minimal depth, in m\",\n \t\t\"object_depth_max\": \"Sample collection maximum depth, in m\",\n \t\t\"process_pixel\": \"Pixel imaging resolution, in µm/pixel\",\n \t\t\"process_id\": \"Segmentation ID\",\n \t\t\"process_uuid\": \"Segmentation UUID (Autogenerated)\",\n \t\t\"process_source\": \"Code source link of the executed code\",\n \t\t\"process_commit\": \"Version reference of the executed code\",\n \t\t\"sample_gear_net_opening\": \"Sample mouth opening dimension, in mm\",\n \t\t\"object_date_end\": \"Sample end collection date when using a net\",\n \t\t\"object_time_end\": \"Sample end collection time when using a net\",\n \t\t\"object_lat_end\": \"Sample end collection latitude when using a net\",\n \t\t\"object_lon_end\": \"Sample end collection longitude when using a net\",\n \t},\n\t\t\"sample_project\": global.get(\"sample_project\"),\n\t\t\"sample_id\": global.get(\"sample_project\") + \"_\" + global.get(\"sample_id\"),\n\t\t\"sample_ship\": global.get(\"sample_ship\"),\n\t\t\"sample_operator\": global.get(\"sample_operator\"),\n\t\t\"sample_sampling_gear\": global.get(\"sample_sampling_gear\"),\n\t\t\"sample_concentrated_sample_volume\": global.get(\"sample_concentrated_sample_volume\"),\n\n\t\t\"acq_id\": global.get(\"sample_project\") + \"_\" + global.get(\"sample_id\")+ \"_\" + global.get(\"acq_id\"),\n\t\t\"acq_instrument\": global.get(\"acq_instrument\"),\n\t\t\"acq_instrument_id\": global.get(\"acq_instrument_id\"),\n\t\t\"acq_celltype\": global.get(\"acq_celltype\"),\n\t\t\"acq_minimum_mesh\": global.get(\"acq_minimum_mesh\"),\n\t\t\"acq_maximum_mesh\": global.get(\"acq_maximum_mesh\"),\n\t\t\"acq_min_esd\": global.get(\"acq_min_esd\"),\n\t\t\"acq_max_esd\": global.get(\"acq_max_esd\"),\n\t\t\"acq_volume\": global.get(\"acq_volume\"),\n\t\t\"acq_imaged_volume\": global.get(\"acq_imaged_volume\"),\n\t\t\"acq_magnification\": global.get(\"magnification\"),\n\t\t\"acq_fnumber_objective\": global.get(\"acq_fnumber_objective\"),\n\t\t\"acq_camera\": global.get(\"acq_camera\"),\n\t\t\"acq_nb_frame\": global.get(\"nb_frame\"),\n\t\t\"acq_software\": global.get(\"acq_software\"),\n\n\t\t\"object_date\": global.get(\"object_date\"),\n\t\t\"object_time\": global.get(\"object_time\"),\n\t\t\"object_lat\": global.get(\"object_lat\"),\n\t\t\"object_lon\": global.get(\"object_lon\"),\n\t\t\"object_depth_min\": global.get(\"object_depth_min\"),\n\t\t\"object_depth_max\": global.get(\"object_depth_max\"),\n\n\t\t\"process_pixel\": global.get(\"process_pixel\"),\n\t\t\"process_id\": global.get(\"process_id\"),\n\t\t\"process_source\": \"https://www.github.com/PlanktonPlanet/PlanktoScope\",\n\t\t\"process_commit\": global.get(\"process_commit\")\n\t}\n};\n\nif (msg.payload.config.sample_sampling_gear.startsWith(\"net\")) {\n\tmsg.payload.config[\"sample_gear_net_opening\"] = global.get(\"sample_gear_net_opening\")\n\tmsg.payload.config[\"object_date_end\"] = global.get(\"object_date_end\")\n\tmsg.payload.config[\"object_time_end\"] = global.get(\"object_time_end\")\n\tmsg.payload.config[\"object_lat_end\"] = global.get(\"object_lat_end\")\n\tmsg.payload.config[\"object_lon_end\"] = global.get(\"object_lon_end\")\n\tmsg.payload.config[\"sample_total_volume\"] = global.get(\"sample_total_volume\")\n}\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", @@ -3472,7 +3441,7 @@ "type": "python3-function", "z": "1371dec5.76e671", "name": "Get MachineName", - "func": "import sys\nsys.path.append('/home/pi/PlanktonScope/scripts')\nimport planktoscope.uuidName\n\nmsg['payload'] = planktoscope.uuidName.machineName(machine=planktoscope.uuidName.getSerial())\nmsg['topic'] = \"acq_instrument_id\";\nreturn msg", + "func": "import sys\nsys.path.append('/home/pi/PlanktoScope/scripts')\nimport planktoscope.uuidName\n\nmsg['payload'] = planktoscope.uuidName.machineName(machine=planktoscope.uuidName.getSerial())\nmsg['topic'] = \"acq_instrument_id\";\nreturn msg", "outputs": 1, "x": 350, "y": 620, @@ -3595,7 +3564,7 @@ "type": "file in", "z": "1c24ad9c.bebec2", "name": "", - "filename": "/home/pi/PlanktonScope/config.json", + "filename": "/home/pi/PlanktoScope/config.json", "format": "utf8", "chunk": false, "sendError": false, @@ -3607,7 +3576,7 @@ "15ceb135.6628bf" ] ], - "info": "# PlanktonScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" + "info": "# PlanktoScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" }, { "id": "15ceb135.6628bf", @@ -3630,7 +3599,7 @@ "type": "file", "z": "1c24ad9c.bebec2", "name": "", - "filename": "/home/pi/PlanktonScope/config.json", + "filename": "/home/pi/PlanktoScope/config.json", "appendNewline": true, "createDir": true, "overwriteFile": "true", @@ -4823,7 +4792,7 @@ "9bd72495.a8a098" ] ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" + "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktoScope/scripts/focus.py 650 up\n" }, { "id": "8e16aa2f.e40398", @@ -4858,7 +4827,7 @@ "8e16aa2f.e40398" ] ], - "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktonScope/scripts/focus.py 650 up\n" + "info": "### Focusing\n##### focus.py `nb_step` `orientation`\n\n- `nb_step` : **integer** (from 1 to 100000) - number of step to perform by the stage (about 31um/step)\n- `orientation` : **string** - orientation of the focus either `up` or `down`\n\nExample:\n\n python3.7 $HOME/PlanktoScope/scripts/focus.py 650 up\n" }, { "id": "43737d43.eb0e9c", @@ -6058,7 +6027,7 @@ "id": "fa914867.0a0658", "type": "exec", "z": "9daf9e2b.019fc", - "command": "python3 -u /home/pi/PlanktonScope/scripts/main.py", + "command": "python3 -u /home/pi/PlanktoScope/scripts/main.py", "addpay": false, "append": "", "useSpawn": "true", @@ -6521,7 +6490,7 @@ "id": "2d2ef1fd.40e6e6", "type": "exec", "z": "9daf9e2b.019fc", - "command": "bash /home/pi/PlanktonScope/scripts/bash/update.sh", + "command": "bash /home/pi/PlanktoScope/scripts/bash/start_update.sh", "addpay": true, "append": "", "useSpawn": "true", @@ -6866,7 +6835,7 @@ "id": "c74fe76.bcba718", "type": "exec", "z": "1371dec5.76e671", - "command": "sudo /home/pi/PlanktonScope/scripts/bash/usb_backup.sh", + "command": "sudo /home/pi/PlanktoScope/scripts/bash/usb_backup.sh", "addpay": true, "append": "", "useSpawn": "true", @@ -7456,7 +7425,7 @@ "type": "file in", "z": "4ed26b8b.253504", "name": "", - "filename": "/home/pi/PlanktonScope/hardware.json", + "filename": "/home/pi/PlanktoScope/hardware.json", "format": "utf8", "chunk": false, "sendError": false, @@ -7468,7 +7437,7 @@ "8c1fda48.d7d828" ] ], - "info": "# PlanktonScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" + "info": "# PlanktoScope Help\nThis Node will read the content of the file named **config.txt** containing all the input placeholders.\n" }, { "id": "8c1fda48.d7d828", @@ -7491,7 +7460,7 @@ "type": "file", "z": "4ed26b8b.253504", "name": "", - "filename": "/home/pi/PlanktonScope/hardware.json", + "filename": "/home/pi/PlanktoScope/hardware.json", "appendNewline": true, "createDir": true, "overwriteFile": "true", @@ -8903,7 +8872,7 @@ "id": "83c5a708.a5715", "type": "exec", "z": "9daf9e2b.019fc", - "command": "git --git-dir=/home/pi/PlanktonScope/.git describe --long --tags", + "command": "git --git-dir=/home/pi/PlanktoScope/.git describe --long --tags", "addpay": false, "append": "", "useSpawn": "true", @@ -8925,7 +8894,7 @@ "id": "d334d264.8a7728", "type": "exec", "z": "9daf9e2b.019fc", - "command": "git --git-dir=/home/pi/PlanktonScope/.git branch --remotes --list | awk '/HEAD/{next;} split($1, a, \"/\") {print a[2]}'", + "command": "git --git-dir=/home/pi/PlanktoScope/.git branch --remotes --list | awk '/HEAD/{next;} split($1, a, \"/\") {print a[2]}'", "addpay": false, "append": "", "useSpawn": "false", diff --git a/morphocut/README.md b/morphocut/README.md deleted file mode 100644 index b67ed76..0000000 --- a/morphocut/README.md +++ /dev/null @@ -1,221 +0,0 @@ -######################################################### -Installation of MorphoCut development version: -######################################################### - -$ pip install -U git+https://github.com/morphocut/morphocut.git -Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple -Collecting git+https://github.com/morphocut/morphocut.git - Cloning https://github.com/morphocut/morphocut.git to /tmp/pip-req-build-NnGYk4 - Installing build dependencies ... error - Complete output from command /usr/bin/python -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-e4DHrk --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- setuptools wheel: - Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple, https://www.piwheels.org/simple - Collecting setuptools - Downloading https://www.piwheels.org/simple/setuptools/setuptools-45.0.0-py2.py3-none-any.whl (583kB) - setuptools requires Python '>=3.5' but the running Python is 2.7.16 - - ---------------------------------------- -Command "/usr/bin/python -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-e4DHrk --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://www.piwheels.org/simple -- setuptools wheel" failed with error code 1 in None - -######################################################### -Installation of MorphoCut packaged on PyPI via pip -######################################################### - -$ pip install morphocut -Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple -Collecting morphocut - Could not find a version that satisfies the requirement morphocut (from versions: ) -No matching distribution found for morphocut - -######################################################### -Installation of MorphoCut packaged on PyPI via pip3 -######################################################### - -$ pip3 install morphocut -Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple -Collecting morphocut - Downloading https://files.pythonhosted.org/packages/7e/c7/1addaf867234dd30db6d1f4bf8d3b685d93b743023a863814451abd5cef8/morphocut-0.1.1-py3-none-any.whl -Collecting scikit-image>=0.16.0 (from morphocut) - Downloading https://www.piwheels.org/simple/scikit-image/scikit_image-0.16.2-cp37-cp37m-linux_armv7l.whl (39.7MB) - 100% |████████████████████████████████| 39.7MB 10kB/s -Collecting tqdm (from morphocut) - Downloading https://files.pythonhosted.org/packages/72/c9/7fc20feac72e79032a7c8138fd0d395dc6d8812b5b9edf53c3afd0b31017/tqdm-4.41.1-py2.py3-none-any.whl (56kB) - 100% |████████████████████████████████| 61kB 1.6MB/s -Collecting scipy (from morphocut) - Downloading https://files.pythonhosted.org/packages/04/ab/e2eb3e3f90b9363040a3d885ccc5c79fe20c5b8a3caa8fe3bf47ff653260/scipy-1.4.1.tar.gz (24.6MB) - 100% |████████████████████████████████| 24.6MB 17kB/s - Installing build dependencies ... done -Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from morphocut) (1.16.2) -Collecting pandas (from morphocut) - Downloading https://www.piwheels.org/simple/pandas/pandas-0.25.3-cp37-cp37m-linux_armv7l.whl (33.1MB) - 100% |████████████████████████████████| 33.1MB 12kB/s -Collecting PyWavelets>=0.4.0 (from scikit-image>=0.16.0->morphocut) - Downloading https://www.piwheels.org/simple/pywavelets/PyWavelets-1.1.1-cp37-cp37m-linux_armv7l.whl (6.1MB) - 100% |████████████████████████████████| 6.1MB 67kB/s -Collecting networkx>=2.0 (from scikit-image>=0.16.0->morphocut) - Downloading https://files.pythonhosted.org/packages/41/8f/dd6a8e85946def36e4f2c69c84219af0fa5e832b018c970e92f2ad337e45/networkx-2.4-py3-none-any.whl (1.6MB) - 100% |████████████████████████████████| 1.6MB 255kB/s -Requirement already satisfied: pillow>=4.3.0 in /usr/lib/python3/dist-packages (from scikit-image>=0.16.0->morphocut) (5.4.1) -Collecting imageio>=2.3.0 (from scikit-image>=0.16.0->morphocut) - Downloading https://files.pythonhosted.org/packages/1a/de/f7f985018f462ceeffada7f6e609919fbcc934acd9301929cba14bc2c24a/imageio-2.6.1-py3-none-any.whl (3.3MB) - 100% |████████████████████████████████| 3.3MB 123kB/s -Collecting python-dateutil>=2.6.1 (from pandas->morphocut) - Downloading https://files.pythonhosted.org/packages/d4/70/d60450c3dd48ef87586924207ae8907090de0b306af2bce5d134d78615cb/python_dateutil-2.8.1-py2.py3-none-any.whl (227kB) - 100% |████████████████████████████████| 235kB 822kB/s -Collecting pytz>=2017.2 (from pandas->morphocut) - Downloading https://files.pythonhosted.org/packages/e7/f9/f0b53f88060247251bf481fa6ea62cd0d25bf1b11a87888e53ce5b7c8ad2/pytz-2019.3-py2.py3-none-any.whl (509kB) - 100% |████████████████████████████████| 512kB 660kB/s -Collecting decorator>=4.3.0 (from networkx>=2.0->scikit-image>=0.16.0->morphocut) - Downloading https://files.pythonhosted.org/packages/8f/b7/f329cfdc75f3d28d12c65980e4469e2fa373f1953f5df6e370e84ea2e875/decorator-4.4.1-py2.py3-none-any.whl -Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.6.1->pandas->morphocut) (1.12.0) -Building wheels for collected packages: scipy - Running setup.py bdist_wheel for scipy ... error - Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-vrivsnzz/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/pip-wheel-2w9xwni0 --python-tag cp37: - Traceback (most recent call last): - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/core/__init__.py", line 16, in - from . import multiarray - ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "", line 1, in - File "/tmp/pip-install-vrivsnzz/scipy/setup.py", line 540, in - setup_package() - File "/tmp/pip-install-vrivsnzz/scipy/setup.py", line 516, in setup_package - from numpy.distutils.core import setup - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/__init__.py", line 142, in - from . import add_newdocs - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/add_newdocs.py", line 13, in - from numpy.lib import add_newdoc - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/lib/__init__.py", line 8, in - from .type_check import * - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/lib/type_check.py", line 11, in - import numpy.core.numeric as _nx - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/core/__init__.py", line 26, in - raise ImportError(msg) - ImportError: - Importing the multiarray numpy extension module failed. Most - likely you are trying to import a failed build of numpy. - If you're working with a numpy git repo, try `git clean -xdf` (removes all - files not under version control). Otherwise reinstall numpy. - - Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory - - - ---------------------------------------- - Failed building wheel for scipy - Running setup.py clean for scipy - Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-vrivsnzz/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" clean --all: - - `setup.py clean` is not supported, use one of the following instead: - - - `git clean -xdf` (cleans all files) - - `git clean -Xdf` (cleans all versioned files, doesn't touch - files that aren't checked into the git repo) - - Add `--force` to your command to use it anyway if you must (unsupported). - - - ---------------------------------------- - Failed cleaning build dir for scipy -Failed to build scipy -Installing collected packages: PyWavelets, decorator, networkx, imageio, scikit-image, tqdm, scipy, python-dateutil, pytz, pandas, morphocut - Running setup.py install for scipy ... error - Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-vrivsnzz/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-s4uxcq_l/install-record.txt --single-version-externally-managed --compile --user --prefix=: - - Note: if you need reliable uninstall behavior, then install - with pip instead of using `setup.py install`: - - - `pip install .` (from a git repo or downloaded source - release) - - `pip install scipy` (last SciPy release on PyPI) - - - Traceback (most recent call last): - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/core/__init__.py", line 16, in - from . import multiarray - ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory - - During handling of the above exception, another exception occurred: - - Traceback (most recent call last): - File "", line 1, in - File "/tmp/pip-install-vrivsnzz/scipy/setup.py", line 540, in - setup_package() - File "/tmp/pip-install-vrivsnzz/scipy/setup.py", line 516, in setup_package - from numpy.distutils.core import setup - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/__init__.py", line 142, in - from . import add_newdocs - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/add_newdocs.py", line 13, in - from numpy.lib import add_newdoc - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/lib/__init__.py", line 8, in - from .type_check import * - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/lib/type_check.py", line 11, in - import numpy.core.numeric as _nx - File "/tmp/pip-build-env-3v411zsn/lib/python3.7/site-packages/numpy/core/__init__.py", line 26, in - raise ImportError(msg) - ImportError: - Importing the multiarray numpy extension module failed. Most - likely you are trying to import a failed build of numpy. - If you're working with a numpy git repo, try `git clean -xdf` (removes all - files not under version control). Otherwise reinstall numpy. - - Original error was: libf77blas.so.3: cannot open shared object file: No such file or directory - - - ---------------------------------------- -Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-vrivsnzz/scipy/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-s4uxcq_l/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-install-vrivsnzz/scipy/ -######################################################### -Installation of Scipy using sudo apt-get -######################################################### - -$ sudo apt-get install python3-scipy -Lecture des listes de paquets... Fait -Construction de l'arbre des dépendances -Lecture des informations d'état... Fait -Les paquets supplémentaires suivants seront installés : - python3-decorator -Paquets suggérés : - python-scipy-doc -Les NOUVEAUX paquets suivants seront installés : - python3-decorator python3-scipy -0 mis à jour, 2 nouvellement installés, 0 à enlever et 41 non mis à jour. -Il est nécessaire de prendre 8 925 ko dans les archives. -Après cette opération, 38,0 Mo d'espace disque supplémentaires seront utilisés. -Souhaitez-vous continuer ? [O/n] o -Réception de :1 http://ftp.igh.cnrs.fr/pub/os/linux/raspbian/raspbian buster/main armhf python3-decorator all 4.3.0-1.1 [14,5 kB] -Réception de :2 http://ftp.igh.cnrs.fr/pub/os/linux/raspbian/raspbian buster/main armhf python3-scipy armhf 1.1.0-7 [8 910 kB] -8 925 ko réceptionnés en 3s (2 561 ko/s) -Sélection du paquet python3-decorator précédemment désélectionné. -(Lecture de la base de données... 99960 fichiers et répertoires déjà installés.) -Préparation du dépaquetage de .../python3-decorator_4.3.0-1.1_all.deb ... -Dépaquetage de python3-decorator (4.3.0-1.1) ... -Sélection du paquet python3-scipy précédemment désélectionné. -Préparation du dépaquetage de .../python3-scipy_1.1.0-7_armhf.deb ... -Dépaquetage de python3-scipy (1.1.0-7) ... -Paramétrage de python3-decorator (4.3.0-1.1) ... -Paramétrage de python3-scipy (1.1.0-7) ... - -######################################################### -Installation of MorphoCut packaged on PyPI via pip3 using sudo -######################################################### - -$ sudo pip3 install morphocut -Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple -Collecting morphocut - Using cached https://files.pythonhosted.org/packages/7e/c7/1addaf867234dd30db6d1f4bf8d3b685d93b743023a863814451abd5cef8/morphocut-0.1.1-py3-none-any.whl -Requirement already satisfied: scikit-image>=0.16.0 in /usr/local/lib/python3.7/dist-packages (from morphocut) (0.16.2) -Requirement already satisfied: numpy in /usr/lib/python3/dist-packages (from morphocut) (1.16.2) -Requirement already satisfied: tqdm in /usr/local/lib/python3.7/dist-packages (from morphocut) (4.41.1) -Requirement already satisfied: pandas in /usr/local/lib/python3.7/dist-packages (from morphocut) (0.25.3) -Requirement already satisfied: scipy in /usr/lib/python3/dist-packages (from morphocut) (1.1.0) -Requirement already satisfied: imageio>=2.3.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image>=0.16.0->morphocut) (2.6.1) -Requirement already satisfied: PyWavelets>=0.4.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image>=0.16.0->morphocut) (1.1.1) -Requirement already satisfied: networkx>=2.0 in /usr/local/lib/python3.7/dist-packages (from scikit-image>=0.16.0->morphocut) (2.4) -Requirement already satisfied: pillow>=4.3.0 in /usr/lib/python3/dist-packages (from scikit-image>=0.16.0->morphocut) (5.4.1) -Requirement already satisfied: python-dateutil>=2.6.1 in /usr/local/lib/python3.7/dist-packages (from pandas->morphocut) (2.8.1) -Requirement already satisfied: pytz>=2017.2 in /usr/local/lib/python3.7/dist-packages (from pandas->morphocut) (2019.3) -Requirement already satisfied: decorator>=4.3.0 in /usr/local/lib/python3.7/dist-packages (from networkx>=2.0->scikit-image>=0.16.0->morphocut) (4.4.1) -Requirement already satisfied: six>=1.5 in /usr/lib/python3/dist-packages (from python-dateutil>=2.6.1->pandas->morphocut) (1.12.0) -Installing collected packages: morphocut -Successfully installed morphocut-0.1.1 diff --git a/morphocut/morphocut.py b/morphocut/morphocut.py deleted file mode 100644 index 9be7fb4..0000000 --- a/morphocut/morphocut.py +++ /dev/null @@ -1,169 +0,0 @@ -"""Experiment on processing KOSMOS data using MorphoCut.""" - -import datetime -import os - -from skimage.util import img_as_ubyte - -from morphocut import Call -from morphocut.contrib.ecotaxa import EcotaxaWriter -from morphocut.contrib.zooprocess import CalculateZooProcessFeatures -from morphocut.core import Pipeline -from morphocut.file import Find -from morphocut.image import ( - ExtractROI, - FindRegions, - ImageReader, - ImageWriter, - RescaleIntensity, - RGB2Gray, -) -from morphocut.stat import RunningMedian -from morphocut.str import Format -from morphocut.stream import TQDM, Enumerate - -from skimage.feature import canny -from skimage.color import rgb2gray, label2rgb -from skimage.morphology import disk -from skimage.morphology import erosion, dilation, closing -from skimage.measure import label, regionprops - - -import_path = "/media/tpollina/rootfs/home/pi/Desktop/PlanktonScope_acquisition/01_17_2020/RAW" -export_path = "/media/tpollina/rootfs/home/pi/Desktop/PlanktonScope_acquisition/01_17_2020/" -CLEAN = os.path.join(export_path, "CLEAN") -os.makedirs(CLEAN, exist_ok=True) - - -OBJECTS = os.path.join(export_path, "OBJECTS") -os.makedirs(OBJECTS, exist_ok=True) - -archive_fn = os.path.join(export_path, "ecotaxa_export.zip") - -# Meta data that is added to every object -global_metadata = { - "acq_instrument": "Planktoscope", - "process_datetime": datetime.datetime.now(), - "sample_project": "PlanktonScope Villefranche", - "sample_ship": "Kayak de Fabien", - "sample_operator": "Thibaut Pollina", - "sample_id": "Flowcam_PlanktonScope_comparison", - "sample_sampling_gear": "net", - "sample_time":150000, - "sample_date":16112020, - "object_lat": 43.696146, - "object_lon": 7.308359, - "acq_fnumber_objective": 16, - "acq_celltype": 200, - "process_pixel": 1.19, - "acq_camera": "Pi Camera V2.1", - "acq_instrument": "PlanktonScope V2.1", - "acq_software": "Node-RED Dashboard and raw python", - "acq_instrument_ID": "copepode", - "acq_volume": 24, - "acq_flowrate": "Unknown", - "acq_camera.resolution" : "(3280, 2464)", - "acq_camera.iso" : 60, - "acq_camera.shutter_speed" : 100, - "acq_camera.exposure_mode" : 'off', - "acq_camera.awb_mode" : 'off', - "acq_nb_frames" : 1000 -} - -# Define processing pipeline -with Pipeline() as p: - # Recursively find .jpg files in import_path. - # Sort to get consective frames. - abs_path = Find(import_path, [".jpg"], sort=True, verbose=True) - - # Extract name from abs_path - name = Call(lambda p: os.path.splitext(os.path.basename(p))[0], abs_path) - - # Read image - img = ImageReader(abs_path) - - # Apply running median to approximate the background image - flat_field = RunningMedian(img, 10) - - # Correct image - img = img / flat_field - - # Rescale intensities and convert to uint8 to speed up calculations - img = RescaleIntensity(img, in_range=(0, 1.1), dtype="uint8") - - # Convert image to uint8 gray - img_gray = RGB2Gray(img) - - img_gray = Call(img_as_ubyte, img_gray) - - img_canny = Call(canny, img_gray, sigma=0.3) - - img_dilate = Call(dilation, img_canny) - - img_closing = Call(closing, img_dilate) - - mask = Call(erosion, img_closing) - - # Show progress bar for frames - TQDM(Format("Frame {name}", name=name)) - - # Apply threshold find objects - #threshold = 204 # Call(skimage.filters.threshold_otsu, img_gray) - #mask = img_gray < threshold - - # Write corrected frames - frame_fn = Format(os.path.join(CLEAN, "{name}.jpg"), name=name) - ImageWriter(frame_fn, img) - - # Find objects - regionprops = FindRegions( - mask, img_gray, min_area=1000, padding=10, warn_empty=name - ) - - # For an object, extract a vignette/ROI from the image - roi_orig = ExtractROI(img, regionprops, bg_color=255) - - roi_orig - # Generate an object identifier - i = Enumerate() - #Call(print,i) - - object_id = Format("{name}_{i:d}", name=name, i=i) - #Call(print,object_id) - - object_fn = Format(os.path.join(OBJECTS, "{name}.jpg"), name=object_id) - ImageWriter(object_fn, roi_orig) - - - # Calculate features. The calculated features are added to the global_metadata. - # Returns a Variable representing a dict for every object in the stream. - meta = CalculateZooProcessFeatures( - regionprops, prefix="object_", meta=global_metadata - ) - # If CalculateZooProcessFeatures is not used, we need to copy global_metadata into the stream: - # meta = Call(lambda: global_metadata.copy()) - # https://github.com/morphocut/morphocut/issues/51 - - # Add object_id to the metadata dictionary - meta["object_id"] = object_id - - # Generate object filenames - orig_fn = Format("{object_id}.jpg", object_id=object_id) - - # Write objects to an EcoTaxa archive: - # roi image in original color, roi image in grayscale, metadata associated with each object - EcotaxaWriter(archive_fn, (orig_fn, roi_orig), meta) - - # Progress bar for objects - TQDM(Format("Object {object_id}", object_id=object_id)) - - -import datetime - -BEGIN = datetime.datetime.now() -# Execute pipeline -p.run() - -END = datetime.datetime.now() - -print("MORPHOCUT :"+str(END-BEGIN)) diff --git a/morphocut/morphocut_opencv.py b/morphocut/morphocut_opencv.py deleted file mode 100644 index 9acf73a..0000000 --- a/morphocut/morphocut_opencv.py +++ /dev/null @@ -1,181 +0,0 @@ -"""Experiment on processing KOSMOS data using MorphoCut.""" - -import datetime -import os - -from skimage.util import img_as_ubyte - -from morphocut import Call -from morphocut.contrib.ecotaxa import EcotaxaWriter -from morphocut.contrib.zooprocess import CalculateZooProcessFeatures -from morphocut.core import Pipeline -from morphocut.file import Find -from morphocut.image import ( - ExtractROI, - FindRegions, - ImageReader, - ImageWriter, - RescaleIntensity, - RGB2Gray, -) -from morphocut.stat import RunningMedian -from morphocut.str import Format -from morphocut.stream import TQDM, Enumerate, FilterVariables - -from skimage.feature import canny -from skimage.color import rgb2gray, label2rgb -from skimage.morphology import disk -from skimage.morphology import erosion, dilation, closing -from skimage.measure import label, regionprops -import cv2 - -import_path = "/home/tpollina/Desktop/JUPYTER/IMAGES/RAW" -export_path = "/home/tpollina/Desktop/JUPYTER/IMAGES/" - -CLEAN = os.path.join(export_path, "CLEAN") -os.makedirs(CLEAN, exist_ok=True) - - -ANNOTATED = os.path.join(export_path, "ANNOTATED") -os.makedirs(ANNOTATED, exist_ok=True) - - -OBJECTS = os.path.join(export_path, "OBJECTS") -os.makedirs(OBJECTS, exist_ok=True) - -archive_fn = os.path.join(export_path, "ecotaxa_export.zip") - -# Meta data that is added to every object -global_metadata = { - "acq_instrument": "Planktoscope", - "process_datetime": datetime.datetime.now(), - "sample_project": "PlanktonScope Villefranche", - "sample_ship": "Kayak de Fabien", - "sample_operator": "Thibaut Pollina", - "sample_id": "Flowcam_PlanktonScope_comparison", - "sample_sampling_gear": "net", - "sample_time":150000, - "sample_date":16112020, - "object_lat": 43.696146, - "object_lon": 7.308359, - "acq_fnumber_objective": 16, - "acq_celltype": 200, - "process_pixel": 1.19, - "acq_camera": "Pi Camera V2.1", - "acq_instrument": "PlanktonScope V2.1", - "acq_software": "Node-RED Dashboard and raw python", - "acq_instrument_ID": "copepode", - "acq_volume": 24, - "acq_flowrate": "Unknown", - "acq_camera.resolution" : "(3280, 2464)", - "acq_camera.iso" : 60, - "acq_camera.shutter_speed" : 100, - "acq_camera.exposure_mode" : 'off', - "acq_camera.awb_mode" : 'off', - "acq_nb_frames" : 1000 -} - -# Define processing pipeline -with Pipeline() as p: - # Recursively find .jpg files in import_path. - # Sort to get consective frames. - abs_path = Find(import_path, [".jpg"], sort=True, verbose=True) - - # Extract name from abs_path - name = Call(lambda p: os.path.splitext(os.path.basename(p))[0], abs_path) - - # Read image - img = ImageReader(abs_path) - - # Show progress bar for frames - #TQDM(Format("Frame {name}", name=name)) - - # Apply running median to approximate the background image - flat_field = RunningMedian(img, 5) - - # Correct image - img = img / flat_field - - # Rescale intensities and convert to uint8 to speed up calculations - img = RescaleIntensity(img, in_range=(0, 1.1), dtype="uint8") - - FilterVariables(name,img) - # - frame_fn = Format(os.path.join(CLEAN, "{name}.jpg"), name=name) - ImageWriter(frame_fn, img) - - # Convert image to uint8 gray - img_gray = RGB2Gray(img) - - # ? - img_gray = Call(img_as_ubyte, img_gray) - - #Canny edge detection - img_canny = Call(cv2.Canny, img_gray, 50,100) - - #Dilate - kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (15, 15)) - img_dilate = Call(cv2.dilate, img_canny, kernel, iterations=2) - - #Close - kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (5, 5)) - img_close = Call(cv2.morphologyEx, img_dilate, cv2.MORPH_CLOSE, kernel, iterations=1) - - #Erode - kernel = Call(cv2.getStructuringElement, cv2.MORPH_ELLIPSE, (15, 15)) - mask = Call(cv2.erode, img_close, kernel, iterations=2) - - frame_fn = Format(os.path.join(ANNOTATED, "{name}.jpg"), name=name) - ImageWriter(frame_fn, mask) - - # Find objects - regionprops = FindRegions( - mask, img_gray, min_area=1000, padding=10, warn_empty=name - ) - # For an object, extract a vignette/ROI from the image - roi_orig = ExtractROI(img, regionprops, bg_color=255) - - # For an object, extract a vignette/ROI from the image - roi_mask = ExtractROI(mask, regionprops, bg_color=255) - - - # Generate an object identifier - i = Enumerate() - #Call(print,i) - - object_id = Format("{name}_{i:d}", name=name, i=i) - #Call(print,object_id) - - object_fn = Format(os.path.join(OBJECTS, "{name}.jpg"), name=object_id) - ImageWriter(object_fn, roi_orig) - - - # Calculate features. The calculated features are added to the global_metadata. - # Returns a Variable representing a dict for every object in the stream. - meta = CalculateZooProcessFeatures( - regionprops, prefix="object_", meta=global_metadata - ) - - # Add object_id to the metadata dictionary - meta["object_id"] = object_id - - # Generate object filenames - orig_fn = Format("{object_id}.jpg", object_id=object_id) - - # Write objects to an EcoTaxa archive: - # roi image in original color, roi image in grayscale, metadata associated with each object - EcotaxaWriter(archive_fn, (orig_fn, roi_orig), meta) - - # Progress bar for objects - TQDM(Format("Object {object_id}", object_id=object_id)) - - -import datetime - -BEGIN = datetime.datetime.now() -# Execute pipeline -p.run() - -END = datetime.datetime.now() - -print("MORPHOCUT :"+str(END-BEGIN)) diff --git a/scripts/gallery/gallery.conf b/scripts/gallery/gallery.conf index c2ac3cd..a842c9d 100644 --- a/scripts/gallery/gallery.conf +++ b/scripts/gallery/gallery.conf @@ -15,12 +15,12 @@ server { } location @autoindex { - xslt_stylesheet /home/pi/PlanktonScope/scripts/gallery/nginx_template.xslt path='$uri'; + xslt_stylesheet /home/pi/PlanktoScope/scripts/gallery/nginx_template.xslt path='$uri'; } # assets, media location ~* \.(?:css(\.map)?|js(\.map)?|svg|ttf|eot|woff|woff2)$ { - root /home/pi/PlanktonScope/scripts/gallery/; + root /home/pi/PlanktoScope/scripts/gallery/; expires 30d; access_log off; } diff --git a/scripts/main.py b/scripts/main.py index 3803a05..d0cb1a0 100644 --- a/scripts/main.py +++ b/scripts/main.py @@ -41,22 +41,22 @@ logger.info("Starting the PlanktoScope python script!") # Library for exchaning messages with Node-RED import planktoscope.mqtt -# Import the planktonscope stepper module +# Import the planktoscope stepper module import planktoscope.stepper -# Import the planktonscope imager module +# Import the planktoscope imager module import planktoscope.imager -# Import the planktonscope segmenter module +# Import the planktoscope segmenter module import planktoscope.segmenter -# Import the planktonscope LED module +# Import the planktoscope LED module import planktoscope.light -# Import the planktonscope uuidName module +# Import the planktoscope uuidName module import planktoscope.uuidName -# Import the planktonscope display module for the OLED screen +# Import the planktoscope display module for the OLED screen import planktoscope.display # global variable that keeps the wheels spinning @@ -93,13 +93,13 @@ if __name__ == "__main__": sys.exit(1) # Let's make sure the used base path exists - img_path = "/home/pi/PlanktonScope/img" + img_path = "/home/pi/PlanktoScope/img" # check if this path exists if not os.path.exists(img_path): # create the path! os.makedirs(img_path) - export_path = "/home/pi/PlanktonScope/export" + export_path = "/home/pi/PlanktoScope/export" # check if this path exists if not os.path.exists(export_path): # create the path! diff --git a/scripts/planktoscope/imager/__init__.py b/scripts/planktoscope/imager/__init__.py index ca02410..77b17e4 100644 --- a/scripts/planktoscope/imager/__init__.py +++ b/scripts/planktoscope/imager/__init__.py @@ -66,9 +66,9 @@ class ImagerProcess(multiprocessing.Process): logger.info("planktoscope.imager is initialising") - if os.path.exists("/home/pi/PlanktonScope/hardware.json"): + if os.path.exists("/home/pi/PlanktoScope/hardware.json"): # load hardware.json - with open("/home/pi/PlanktonScope/hardware.json", "r") as config_file: + with open("/home/pi/PlanktoScope/hardware.json", "r") as config_file: configuration = json.load(config_file) logger.debug(f"Hardware configuration loaded is {configuration}") else: diff --git a/scripts/planktoscope/imager/raspimjpeg.py b/scripts/planktoscope/imager/raspimjpeg.py index 2e0903f..c161993 100644 --- a/scripts/planktoscope/imager/raspimjpeg.py +++ b/scripts/planktoscope/imager/raspimjpeg.py @@ -21,8 +21,8 @@ import subprocess # nosec ################################################################################ class raspimjpeg(object): def __init__(self, *args, **kwargs): - self.__configfile = "/home/pi/PlanktonScope/scripts/raspimjpeg/raspimjpeg.conf" - self.__binary = "/home/pi/PlanktonScope/scripts/raspimjpeg/bin/raspimjpeg" + self.__configfile = "/home/pi/PlanktoScope/scripts/raspimjpeg/raspimjpeg.conf" + self.__binary = "/home/pi/PlanktoScope/scripts/raspimjpeg/bin/raspimjpeg" self.__statusfile = "/dev/shm/mjpeg/status_mjpeg.txt" # nosec self.__pipe = "/dev/shm/mjpeg/FIFO" # nosec self.__sensor_name = "" diff --git a/scripts/planktoscope/segmenter/__init__.py b/scripts/planktoscope/segmenter/__init__.py index 67eb774..cabd452 100644 --- a/scripts/planktoscope/segmenter/__init__.py +++ b/scripts/planktoscope/segmenter/__init__.py @@ -975,9 +975,4 @@ class SegmenterProcess(multiprocessing.Process): # This is called if this script is launched directly if __name__ == "__main__": # TODO This should be a test suite for this library - segmenter_thread = SegmenterProcess( - None, "/home/rbazile/Documents/pro/PlanktonPlanet/Planktonscope/Segmenter/data/" - ) - segmenter_thread.segment_path( - "/home/rbazile/Documents/pro/PlanktonPlanet/Planktonscope/Segmenter/data/test" - ) + pass diff --git a/scripts/planktoscope/segmenter/ecotaxa.py b/scripts/planktoscope/segmenter/ecotaxa.py index b6f59c7..c8b6ab4 100644 --- a/scripts/planktoscope/segmenter/ecotaxa.py +++ b/scripts/planktoscope/segmenter/ecotaxa.py @@ -18,7 +18,7 @@ Example of metadata file received "sample_sampling_gear": "net_hsn", "sample_concentrated_sample_volume": 100, "acq_id": "Tara atlantique sud 2021_hsn_2021_01_22_1", - "acq_instrument": "PlanktonScope v2.2", + "acq_instrument": "PlanktoScope v2.2", "acq_instrument_id": "Babane Batoukoa", "acq_celltype": 300, "acq_minimum_mesh": 20, diff --git a/scripts/planktoscope/stepper.py b/scripts/planktoscope/stepper.py index c4acad6..f884fd7 100644 --- a/scripts/planktoscope/stepper.py +++ b/scripts/planktoscope/stepper.py @@ -165,10 +165,10 @@ class stepper: class StepperProcess(multiprocessing.Process): focus_steps_per_mm = 40 - # 507 steps per ml for Planktonscope standard + # 507 steps per ml for PlanktoScope standard # 5200 for custom NEMA14 pump with 0.8mm ID Tube pump_steps_per_ml = 507 - # focus max speed is in mm/sec and is limited by the maximum number of pulses per second the Planktonscope can send + # focus max speed is in mm/sec and is limited by the maximum number of pulses per second the PlanktoScope can send focus_max_speed = 0.5 # pump max speed is in ml/min pump_max_speed = 30 @@ -182,9 +182,9 @@ class StepperProcess(multiprocessing.Process): self.stop_event = event - if os.path.exists("/home/pi/PlanktonScope/hardware.json"): + if os.path.exists("/home/pi/PlanktoScope/hardware.json"): # load hardware.json - with open("/home/pi/PlanktonScope/hardware.json", "r") as config_file: + with open("/home/pi/PlanktoScope/hardware.json", "r") as config_file: configuration = json.load(config_file) logger.debug(f"Hardware configuration loaded is {configuration}") else: @@ -539,4 +539,4 @@ if __name__ == "__main__": # This needs to be in a threading or multiprocessing wrapper stepper_thread = StepperProcess() stepper_thread.start() - stepper_thread.join() \ No newline at end of file + stepper_thread.join() diff --git a/scripts/raspimjpeg/raspimjpeg.conf b/scripts/raspimjpeg/raspimjpeg.conf index 6e4ef50..9e4ee45 100644 --- a/scripts/raspimjpeg/raspimjpeg.conf +++ b/scripts/raspimjpeg/raspimjpeg.conf @@ -118,7 +118,7 @@ motion_file 0 # macros_path can be used to store macros executed by sy command # boxing_path if set is where h264 files will be temporarily stored when boxing used # image, video and lapse may be configured relative to media_path if first / left out -base_path /home/pi/PlanktonScope/scripts/raspimjpeg/ +base_path /home/pi/PlanktoScope/scripts/raspimjpeg/ preview_path /dev/shm/mjpeg/cam.jpg image_path /dev/shm/mjpeg/image.jpg lapse_path /dev/shm/mjpeg/tl_%i_%t_%Y%M%D_%h%m%s.jpg @@ -126,7 +126,7 @@ video_path /dev/shm/mjpeg/vi_%v_%Y%M%D_%h%m%s.mp4 status_file /dev/shm/mjpeg/status_mjpeg.txt control_file /dev/shm/mjpeg/FIFO media_path /home/pi/data/ -macros_path /home/pi/PlanktonScope/scripts/raspimjpeg/macros +macros_path /home/pi/PlanktoScope/scripts/raspimjpeg/macros user_annotate /dev/shm/mjpeg/user_annotate.txt boxing_path subdir_char @ @@ -168,9 +168,9 @@ callback_timeout 30 user_config #logfile for raspimjpeg, default to merge with scheduler log -log_file /home/pi/PlanktonScope/scripts/raspimjpeg/raspimjpeg.log +log_file /home/pi/PlanktoScope/scripts/raspimjpeg/raspimjpeg.log log_size 10000 -motion_logfile /home/pi/PlanktonScope/scripts/raspimjpeg/motion.log +motion_logfile /home/pi/PlanktoScope/scripts/raspimjpeg/motion.log #enforce_lf set to 1 to only process FIFO commands when terminated with LF enforce_lf 1