Skip to content

Commit

Permalink
merge conflicts
Browse files Browse the repository at this point in the history
Former-commit-id: f96833d
  • Loading branch information
skim2257 committed Jun 13, 2022
1 parent 7bc5404 commit 22b6678
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 7 deletions.
7 changes: 4 additions & 3 deletions imgtools/modules/datagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,9 +342,10 @@ def _form_agg(self):
'''
Form aggregates for easier parsing, gets the edge types for each study and aggregates as a string. This way one can do regex based on what type of subgraph the user wants
'''
self.df_new = self.df_edges.groupby("study_x").agg({'edge_type':self.list_edges})
self.df_new.reset_index(level=0, inplace=True)
self.df_new["edge_type"] = self.df_new["edge_type"].astype(str)
self.df_edges['edge_type_str'] = self.df_edges['edge_type'].astype(str)
self.df_new = self.df_edges.groupby("study_x").agg({'edge_type_str':self.list_edges})
self.df_new.reset_index(level=0, inplace=True)
self.df_new["edge_type"] = self.df_new["edge_type_str"]

def _get_df(self,
df_edges_processed,
Expand Down
3 changes: 3 additions & 0 deletions imgtools/modules/segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ def generate_sparse_mask(self, verbose=False) -> SparseMask:

if verbose:
voxels_with_overlap = set()

if len(mask_arr.shape) == 4:
for i in range(mask_arr.shape[0]):
slice = mask_arr[i, :, :, :]
Expand All @@ -125,9 +126,11 @@ def generate_sparse_mask(self, verbose=False) -> SparseMask:
sparsemask_arr = mask_arr

sparsemask = SparseMask(sparsemask_arr, roi_names)

if verbose:
if len(voxels_with_overlap) != 0:
raise Warning(f"{len(voxels_with_overlap)} voxels have overlapping contours.")

return sparsemask

def _max_adder(self, arr_1: np.ndarray, arr_2: np.ndarray) -> Tuple[np.ndarray, Set[Tuple[int, int, int]]]:
Expand Down
4 changes: 2 additions & 2 deletions imgtools/utils/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ def parser():
parser.add_argument("--nnunet_study_name", type=str, default=None,
help="Name of the study to be used for nn-Unet.")

parser.add_argument("train_size", type=float, default=1.0,
parser.add_argument("--train_size", type=float, default=1.0,
help="The proportion of data to be used for training, as a decimal.")

parser.add_argument("random_state", type=int, default=42,
parser.add_argument("--random_state", type=int, default=42,
help="The random state to be used for the train-test-split.")

return parser.parse_known_args()[0]
5 changes: 4 additions & 1 deletion imgtools/utils/crawl.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,10 @@ def crawl(top,
parent_imgtools = pathlib.Path(parent, ".imgtools").as_posix()

if not os.path.exists(parent_imgtools):
os.makedirs(parent_imgtools)
try:
os.makedirs(parent_imgtools)
except:
pass

# save as json
with open(pathlib.Path(parent_imgtools, f'imgtools_{dataset}.json').as_posix(), 'w') as f:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
extras_require={
'debug': ['pyvis'],
},
entry_points={'console_scripts': ['autopipe = imgtools.autopipeline:main']},
entry_points={'console_scripts': ['autopipe = imgtools.autopipeline:main', 'autotest = imgtools.autonew:main']},
classifiers=[
"Programming Language :: Python :: 3",
"Operating System :: OS Independent",
Expand Down

0 comments on commit 22b6678

Please sign in to comment.