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

Add spectial condition to check that file exist. Avoid stitching when only one tile tis processed

parent 4616a24f
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@
## Install as a FiJi Plugins
1. Locate the folder where your ImageJ is installed
1. Locate the folder where your ImageJ is installed (For mac users it could be locate on the Applications forlder, right click on FiJi and then "Show Package Contents" to access the FiJi folder)
2. Add a folder **disco_ij** in the **Fiji.app/plugins** folder an copy the **script_mosaic_telemos.py** into the **disco_ij** folder.
3. Copy the **utils** folder into **Fiji.app/jars/Lib** directory
4. In Fiji **help>refresh menus** and **restart FiJi*
......
......@@ -18,7 +18,7 @@ Used IJ plugins: Bio-Formats, BaSIC
import glob
from ij import IJ, ImagePlus, ImageStack
from ij import IJ, ImagePlus, ImageStack, Macro
from ij.process import FloatProcessor
import os
import json
......@@ -27,6 +27,7 @@ from fiji.util.gui import GenericDialogPlus
from java.awt.event import WindowAdapter
from java.lang import Thread
from ij import WindowManager
from java.lang import RuntimeException
import re
import sys
......@@ -134,7 +135,7 @@ def load_image_tiles_stack(images_dir):
- Outils grille (create grid) du multi position
"""
d = images_dir
d = str(images_dir)
# Travail sur le nom du repertoir
......@@ -153,6 +154,7 @@ def load_image_tiles_stack(images_dir):
# Test if the format is from MDAQ with only Default folrder in (when multipos is untick)
directoryDefault = os.path.join(os.path.abspath(d), 'Default')
regex_cpt_roi = None
if len(filesSE) > 0:
format = 'SE'
files = filesSE
......@@ -579,6 +581,7 @@ def run_processing(channel, zimg, zwhite, run_basic=True, optimizeXY=True, savep
imp_tmp = IJ.getImage()
imp_tmp.close()
if tilesposfile is not None:
IJ.log("Run stitching of tiles")
# Run the stitching
# Autre option si on a pas mal de ram sur l'ordinateur 'Save computation time (but use more RAM)'
......@@ -908,6 +911,15 @@ if __name__ in ['__builtin__','__main__']:
IJ.log("Dark of white stack: %s" % fdarkwhite)
IJ.log("White stack: %s" % fwhite)
# Sanity checks if files are accessible or not
all_good = True
for ff in [str(fdata), str(fdark), str(fdarkwhite), str(fwhite)]:
if not os.path.exists(str(fdata)):
IJ.log("The path "+ff+" does not exist or is not acessible")
all_good = False
if all_good:
# LOAD DATA
hstack, metadata, rootdir, selectedroi, file_names = load_image_tiles_stack(fdata)
hstack.show()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment