diff --git a/PyNutil.py b/PyNutil/PyNutil.py similarity index 98% rename from PyNutil.py rename to PyNutil/PyNutil.py index 9ed2f15aeaff17b7456f0a0ba9d02795f11e504c..d0df0b9c7c04de51d13ba9a2873559d0803d5bff 100644 --- a/PyNutil.py +++ b/PyNutil/PyNutil.py @@ -154,7 +154,7 @@ def WritePointsToMeshview(points, pointNames, filename, infoFile): WritePoints(regionDict, filename, infoFile) 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. it returns a dictionary with the region as the key and the points as the value""" #first convert the points to 3 columns @@ -169,3 +169,4 @@ def labelPoints(points, label_volume, scale_factor=1): #get the label value for each point labels = label_volume[x,y,z] return labels + diff --git a/basic_workflow.py b/workflows/basic_workflow.py similarity index 84% rename from basic_workflow.py rename to workflows/basic_workflow.py index e4912d2a88ffc34b00971930b0d291a22d0b8aa5..61e4a9f237b335a813974cfff0ae14e26b6ca196 100644 --- a/basic_workflow.py +++ b/workflows/basic_workflow.py @@ -2,8 +2,12 @@ import pandas as pd #nrrd just lets us open nrrd files 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 -from PyNutil import FolderToAtlasSpace, labelPoints, WritePointsToMeshview +from PyNutil.PyNutil import FolderToAtlasSpace, labelPoints, WritePointsToMeshview segmentation_folder = "test_data/oneSection15/"