From f48f139be57d77f2e0e11bc0b8b74e67518eac90 Mon Sep 17 00:00:00 2001 From: Harry Carey <38996929+PolarBean@users.noreply.github.com> Date: Tue, 25 Apr 2023 21:13:27 +0200 Subject: [PATCH] restructured package --- PyNutil.py => PyNutil/PyNutil.py | 3 ++- basic_workflow.py => workflows/basic_workflow.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) rename PyNutil.py => PyNutil/PyNutil.py (98%) rename basic_workflow.py => workflows/basic_workflow.py (84%) diff --git a/PyNutil.py b/PyNutil/PyNutil.py similarity index 98% rename from PyNutil.py rename to PyNutil/PyNutil.py index 9ed2f15..d0df0b9 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 e4912d2..61e4a9f 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/" -- GitLab