From 1474c5fea444d094ff83e409a6c0306dc2cb286f Mon Sep 17 00:00:00 2001 From: Harry Carey <38996929+PolarBean@users.noreply.github.com> Date: Tue, 25 Apr 2023 21:23:13 +0200 Subject: [PATCH] restructuring and adding comments --- .../visualign_deformations.py | 0 ...ow.py => folder_of_segmentations_to_meshview.py} | 13 ++++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) rename VisuAlignWarpVec.py => PyNutil/visualign_deformations.py (100%) rename workflows/{basic_workflow.py => folder_of_segmentations_to_meshview.py} (69%) diff --git a/VisuAlignWarpVec.py b/PyNutil/visualign_deformations.py similarity index 100% rename from VisuAlignWarpVec.py rename to PyNutil/visualign_deformations.py diff --git a/workflows/basic_workflow.py b/workflows/folder_of_segmentations_to_meshview.py similarity index 69% rename from workflows/basic_workflow.py rename to workflows/folder_of_segmentations_to_meshview.py index 61e4a9f..d90da81 100644 --- a/workflows/basic_workflow.py +++ b/workflows/folder_of_segmentations_to_meshview.py @@ -10,14 +10,14 @@ sys.path.append('..') from PyNutil.PyNutil import FolderToAtlasSpace, labelPoints, WritePointsToMeshview -segmentation_folder = "test_data/oneSection15/" -alignment_json = "test_data/C68_nonlinear.json" +segmentation_folder = "../test_data/oneSection15/" +alignment_json = "../test_data/C68_nonlinear.json" #now we can use our function to convert the folder of segmentations to points points = FolderToAtlasSpace(segmentation_folder,alignment_json, pixelID=[255, 0, 255], nonLinear=True) #first we need to find the label file for the volume -label_path = "annotation_volumes//allen2022_colours.csv" +label_path = "../annotation_volumes//allen2022_colours.csv" #then the path to the volume -volume_path = "annotation_volumes//annotation_10_reoriented.nrrd" +volume_path = "../annotation_volumes//annotation_10_reoriented.nrrd" #read the label file label_df = pd.read_csv(label_path) #read the annotation volume, it also has a header but we don't need it @@ -25,4 +25,7 @@ data, header = nrrd.read(volume_path) #now we can get the labels for each point labels = labelPoints(points, data, scale_factor=2.5) #save points to a meshview json -WritePointsToMeshview(points, labels,"outputs/points.json", label_df) +WritePointsToMeshview(points, labels,"../outputs/points.json", label_df) + +#while we havent added it here it would be good to next quantify the number of cells for each label. + -- GitLab