Skip to content
Snippets Groups Projects
Commit 1474c5fe authored by Harry Carey's avatar Harry Carey
Browse files

restructuring and adding comments

parent f48f139b
No related branches found
No related tags found
No related merge requests found
File moved
......@@ -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.
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment