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

restructured package

parent bb9c7c30
No related branches found
No related tags found
No related merge requests found
...@@ -154,7 +154,7 @@ def WritePointsToMeshview(points, pointNames, filename, infoFile): ...@@ -154,7 +154,7 @@ def WritePointsToMeshview(points, pointNames, filename, infoFile):
WritePoints(regionDict, filename, infoFile) WritePoints(regionDict, filename, infoFile)
def labelPoints(points, label_volume, scale_factor=1): def labelPoints(points, label_volume, scale_factor=1):
"""this function takes a list of points and assigns them to a region based on the regionVolume. """this function takes a list of points and assigns them to a region based on the regionVolume.
These regions will just be the values in the regionVolume at the points. These regions will just be the values in the regionVolume at the points.
it returns a dictionary with the region as the key and the points as the value""" it returns a dictionary with the region as the key and the points as the value"""
#first convert the points to 3 columns #first convert the points to 3 columns
...@@ -169,3 +169,4 @@ def labelPoints(points, label_volume, scale_factor=1): ...@@ -169,3 +169,4 @@ def labelPoints(points, label_volume, scale_factor=1):
#get the label value for each point #get the label value for each point
labels = label_volume[x,y,z] labels = label_volume[x,y,z]
return labels return labels
...@@ -2,8 +2,12 @@ ...@@ -2,8 +2,12 @@
import pandas as pd import pandas as pd
#nrrd just lets us open nrrd files #nrrd just lets us open nrrd files
import nrrd import nrrd
#this is a hack to let us import as if we are in the parent directory
import sys
sys.path.append('..')
#import our function for converting a folder of segmentations to points #import our function for converting a folder of segmentations to points
from PyNutil import FolderToAtlasSpace, labelPoints, WritePointsToMeshview from PyNutil.PyNutil import FolderToAtlasSpace, labelPoints, WritePointsToMeshview
segmentation_folder = "test_data/oneSection15/" segmentation_folder = "test_data/oneSection15/"
......
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