Skip to content
Snippets Groups Projects
Commit 551d1f03 authored by Hugo CHAUVET's avatar Hugo CHAUVET :bicyclist:
Browse files

Fix bug for non-mosaic acquisition

parent 711721ec
No related branches found
No related tags found
No related merge requests found
...@@ -450,7 +450,11 @@ def process_tiles(implus_tiles_stack, channel, z, implus_white_corr, implus_dark ...@@ -450,7 +450,11 @@ def process_tiles(implus_tiles_stack, channel, z, implus_white_corr, implus_dark
for tile in xrange(Ntiles): for tile in xrange(Ntiles):
IJ.showProgress(tile+1, Ntiles) IJ.showProgress(tile+1, Ntiles)
IJ.log('Compute %i / %i' % (tile+1, Ntiles)) IJ.log('Compute %i / %i' % (tile+1, Ntiles))
if Ntiles > 1:
data_views = Views.hyperSlice(data, 2, tile) data_views = Views.hyperSlice(data, 2, tile)
else:
data_views = data
opsus = sub(data_views, dark) opsus = sub(data_views, dark)
# FOR DEGUG: op[cpt] = sub(data_views, dark) # FOR DEGUG: op[cpt] = sub(data_views, dark)
op[cpt] = IF(GT(opsus, 0.0), THEN(div(opsus, white)), ELSE(0.0)) op[cpt] = IF(GT(opsus, 0.0), THEN(div(opsus, white)), ELSE(0.0))
......
...@@ -28,7 +28,7 @@ def load_mm_images(rootdir, roi=1, tile=True, pos=False, ...@@ -28,7 +28,7 @@ def load_mm_images(rootdir, roi=1, tile=True, pos=False,
if not tile and pos: if not tile and pos:
stack_order = ['position', 'time', 'z', 'channels'] stack_order = ['position', 'time', 'z', 'channels']
image_files = generate_file_list(metadata, roi, tile, pos, stack_order) image_files = generate_file_list(metadata, rootdir, roi, tile, pos, stack_order)
# Create the virtual stack # Create the virtual stack
vstack = VirtualStack(dimensions['width'], dimensions['height'], None, rootdir) vstack = VirtualStack(dimensions['width'], dimensions['height'], None, rootdir)
......
...@@ -195,7 +195,7 @@ def get_stage_positions_labels(metadata): ...@@ -195,7 +195,7 @@ def get_stage_positions_labels(metadata):
return stage_label return stage_label
def generate_file_list(metadata, roi=1, tile=True, pos=False, stack_order=None): def generate_file_list(metadata, rootdir, roi=1, tile=True, pos=False, stack_order=None):
""" """
Generate a list of all images to load from the metadata Generate a list of all images to load from the metadata
...@@ -228,6 +228,15 @@ def generate_file_list(metadata, roi=1, tile=True, pos=False, stack_order=None): ...@@ -228,6 +228,15 @@ def generate_file_list(metadata, roi=1, tile=True, pos=False, stack_order=None):
else: else:
pre_folder = 'Default' # Is redefined pre_folder = 'Default' # Is redefined
# Test if the folder delfault is present
# Test the name of root folder for images
if rootdir is not None:
if not os.path.isdir(os.path.join(rootdir, 'Default')):
if os.path.isdir(os.path.join(rootdir, 'Pos0')):
pre_folder = 'Pos0'
else:
print('No folder found !')
# Get the combination of all conditions of acquisitions # Get the combination of all conditions of acquisitions
all_conditions, ordered_keys = groups_dimensions(metadata, roi, stack_order) all_conditions, ordered_keys = groups_dimensions(metadata, roi, stack_order)
...@@ -247,7 +256,7 @@ def generate_file_list(metadata, roi=1, tile=True, pos=False, stack_order=None): ...@@ -247,7 +256,7 @@ def generate_file_list(metadata, roi=1, tile=True, pos=False, stack_order=None):
min_pos_index = 0 min_pos_index = 0
if pos: if pos:
# Define the pre_folder # Define the pre_folder
pre_folder = 'Pos{i}'.format(i=group[ordered_keys.index('position')]) pre_folder = 'Pos{i}'.format(i=group[ordered_keys.index('position')])
base_fmt = fmtMM2.format(filter=group[ordered_keys.index('channels')], base_fmt = fmtMM2.format(filter=group[ordered_keys.index('channels')],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment