-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create application_EBSS_120hrs_gaohan_data_normalize_conversion…
….ipynb
- Loading branch information
1 parent
6533c04
commit 51f1cf8
Showing
1 changed file
with
134 additions
and
0 deletions.
There are no files selected for viewing
134 changes: 134 additions & 0 deletions
134
notebooks/application_EBSS_120hrs_gaohan_data_normalize_conversion.ipynb
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,134 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# Create Napari UI for editing SingleCellTrajectoryCollection (SCTC)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Loading sample data and create a sample trajectory collection" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from pathlib import Path\n", | ||
"from livecellx.sample_data import tutorial_three_image_sys\n", | ||
"\n", | ||
"from livecellx.core.io_sc import prep_scs_from_mask_dataset\n", | ||
"\n", | ||
"from livecellx.core.single_cell import (\n", | ||
" SingleCellStatic,\n", | ||
" SingleCellTrajectory,\n", | ||
" SingleCellTrajectoryCollection,\n", | ||
")\n", | ||
"\n", | ||
"\n", | ||
"# scs_path = r\"D:\\LiveCellTracker-dev\\notebooks\\application_results\\5days_notreat_XY03_max_age=3_min_hits=1\\5days_notreat_XY03_max_age=3_min_hits=1.json\"\n", | ||
"scs_path = (\n", | ||
" Path(\n", | ||
" r\"D:\\LiveCellTracker-dev\\notebooks\\application_results\\Gaohan_5days_notreat\\pos_scs\"\n", | ||
" )\n", | ||
" / \"XY03_scs.json\"\n", | ||
")\n", | ||
"scs_path = scs_path.as_posix()\n", | ||
"scs = SingleCellStatic.load_single_cells_json(scs_path)\n", | ||
"# sctc = SingleCellTrajectoryCollection.load_from_json_file(scs_path)\n", | ||
"\n", | ||
"# single_cells = prep_scs_from_mask_dataset(mask_dataset, dic_dataset)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"39340" | ||
] | ||
}, | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"len(scs)" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from typing import List\n", | ||
"from livecellx.track.sort_tracker_utils import (\n", | ||
" gen_SORT_detections_input_from_contours,\n", | ||
" update_traj_collection_by_SORT_tracker_detection,\n", | ||
" track_SORT_bbox_from_contours,\n", | ||
" track_SORT_bbox_from_scs,\n", | ||
")\n", | ||
"\n", | ||
"\n", | ||
"dic_dataset = scs[0].img_dataset\n", | ||
"mask_dataset = scs[0].mask_dataset" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"|-----> Creating output directory E:\\xing-imaging\\tifs_CFP_A549_VIM_120hr_NoTreat_NA_YL_Ti2e_2023-03-22\\tifs_CFP_A549_VIM_120hr_NoTreat_NA_YL_Ti2e_2023-03-22\\XY03\\DIC_8bit\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"import importlib\n", | ||
"import livecellx\n", | ||
"from livecellx.preprocess.conversion import (\n", | ||
" convert_livecell_dataset\n", | ||
")\n", | ||
"importlib.reload(livecellx.preprocess.conversion) \n", | ||
"out_dir = r\"E:\\xing-imaging\\tifs_CFP_A549_VIM_120hr_NoTreat_NA_YL_Ti2e_2023-03-22\\tifs_CFP_A549_VIM_120hr_NoTreat_NA_YL_Ti2e_2023-03-22\\XY03\\DIC_8bit\"\n", | ||
"livecellx.preprocess.conversion.convert_livecell_dataset(dic_dataset, out_dir=out_dir)" | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "livecell-work", | ||
"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.9.16" | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |