Skip to content

Commit

Permalink
Merge branch 'hotfix'
Browse files Browse the repository at this point in the history
  • Loading branch information
crousseau committed Jul 22, 2024
2 parents d249c8d + 7c3e8f6 commit 5408fff
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 6 deletions.
1 change: 1 addition & 0 deletions ClearMap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ dependencies:
- scikit-learn
- graph-tool
- pytorch
- mkl<2024.1 # Breaks pytorch (https://github.com/pytorch/pytorch/issues/123097)
- pip:
- lxml
5 changes: 3 additions & 2 deletions ClearMap/ImageProcessing/Binary/Smoothing.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ def smooth_by_configuration_block(source, iterations = 1, verbose = False):
Returns
-------
smoothed : array
Thre smoothed binary array.
The smoothed binary array.
"""
try:
if isinstance(source, io.src.Source):
Expand All @@ -360,8 +360,9 @@ def smooth_by_configuration_block(source, iterations = 1, verbose = False):
smoothed = lut[smoothed];

if verbose:
print(f'Binary Smoothing: itertion {i+1} / {iterations} done!', flush=True)
print(f'Binary Smoothing: iteration {i+1} / {iterations} done!', flush=True)
except Exception as err:
print(f"ERROR in smooth_by_configuration")
print(err, flush=True)
raise

Expand Down
2 changes: 2 additions & 0 deletions ClearMap/processors/generic_tab_processor.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os
import sys
import warnings
from concurrent.futures.process import BrokenProcessPool


Expand Down Expand Up @@ -33,6 +34,7 @@ def remove_next_steps_files(self, target_step_name):
for step_name in self.get_next_steps(target_step_name):
f_path = self.path_from_step_name(step_name)
if os.path.exists(f_path):
warnings.warn(f"WARNING: Remove previous step {step_name}, file {f_path}")
os.remove(f_path)

def path(self, step, step_back=False, n_before=0):
Expand Down
8 changes: 4 additions & 4 deletions ClearMap/processors/tube_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def _binarize(self, n_processes, clip_range, deconvolve_threshold, channel):
postfix = channel if channel == 'arteries' else None
self.steps[channel].remove_next_steps_files(self.steps[channel].binary)

source = self.workspace.filename('stitched', postfix=postfix)
source = self.workspace.source('stitched', postfix=postfix)
sink = self.workspace.filename('binary', postfix=postfix)

binarization_parameter = copy.deepcopy(vasculature.default_binarization_parameter)
Expand Down Expand Up @@ -242,7 +242,7 @@ def smooth(self, channel):

self.steps[channel].remove_next_steps_files(self.steps[channel].postprocessed)

source = self.workspace.filename('binary', postfix=postfix)
source = self.workspace.source('binary', postfix=postfix)
sink_postfix = f'{postfix}_postprocessed' if postfix else 'postprocessed'
sink = self.workspace.filename('binary', postfix=sink_postfix)
sink = initialize_sink(sink, shape=source.shape, dtype=source.dtype, order=source.order,
Expand Down Expand Up @@ -340,7 +340,7 @@ def plot_combined(self, parent=None, arrange=False): # TODO: final or not optio
def combine_binary(self):
# MERGE
sink = self.workspace.filename('binary', postfix='combined') # Temporary
if not self.processing_config['binarization']['arteries']['binarization']['run']:
if self.processing_config['binarization']['arteries']['binarization']['run']:
source = self.workspace.filename('binary', postfix='filled')
source_arteries = self.workspace.filename('binary', postfix='arteries_filled')
block_processing.process(np.logical_or, [source, source_arteries], sink,
Expand Down Expand Up @@ -494,7 +494,7 @@ def skeletonize_and_build_graph(self):
self.processing_config.reload()
graph_cfg = self.processing_config['graph_construction']
self.skeletonize(self.workspace.filename('skeleton'))# WARNING: main thread (prange)
if graph_cfg['build'] or graph_cfg['skeletonize']:
if graph_cfg['build']:
self._build_graph_from_skeleton() # WARNING: main thread (prange)

def clean_graph(self):
Expand Down
1 change: 1 addition & 0 deletions ClearMapUi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies:
- scikit-learn
- graph-tool<=2.45 # Cannot remove self loops with later versions
- pytorch<=1.11
- mkl<2024.1 # Breaks pytorch (https://github.com/pytorch/pytorch/issues/123097)
- cudatoolkit=11.6
- configobj
- natsort
Expand Down
1 change: 1 addition & 0 deletions ClearMapUi39.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ dependencies:
- scikit-learn
- graph-tool<=2.45 # Cannot remove self loops with later versions
- pytorch<=1.11 # could probably upgrade
- mkl<2024.1 # Breaks pytorch (https://github.com/pytorch/pytorch/issues/123097)
- cudatoolkit=11.6
- configobj
- natsort
Expand Down

0 comments on commit 5408fff

Please sign in to comment.