Conform your data
Spots in yeasts
expects a very precise file as its input:
The file must be a TIFF (no .czi, .nd, …)
Both channels must be packed in this TIFF.
The first channel must contain the spots and the second the brightfield.
The number of slices is arbitrary.
If your images don’t have this form, we provide you with a Fiji/ImageJ plugin that can achieve the conversion. To use it, just proceed as follow:
Install the macro
Start by opening Fiji.
In the menu bar, go in
File
→New
→Text Window
.In the new window that just appeared, click on the
Language
button in the menu bar, and choosePython
.Copy the following code, and paste it in your code window.
from ij import IJ, Menus
import os
import urllib2
import sys
def empty_folder(folder_path):
for f in os.listdir(folder_path):
file_path = os.path.join(folder_path, f)
if os.path.isfile(file_path):
os.remove(file_path)
elif os.path.isdir(file_path):
empty_folder(file_path)
os.rmdir(file_path)
plugins_folder = IJ.getDirectory("plugins")
convert_folder = os.path.join(plugins_folder, "siy-data-cast")
if os.path.isdir(convert_folder):
empty_folder(convert_folder)
else:
os.mkdir(convert_folder)
# # # At this point, the folder shoud exist and be empty # # #
files = [
"siy-convert-format.py"
]
base_url = "https://raw.githubusercontent.com/MontpellierRessourcesImagerie/spots-in-yeasts/master/src/spots_in_yeasts/"
for name in files:
fullPath = os.path.join(convert_folder, name)
fullURL = base_url + name
try:
with open(fullPath,'wb') as fi:
fi.write(urllib2.urlopen(fullURL).read())
fi.close()
except:
print("Failed to download " + name)
else:
print("Downloaded " + name + " successfully.")
print("DONE.")
Below the text area in the window, you can click the
Run
button.You can now close Fiji without saving anything, the macro is installed.
Use the macro
Launch Fiji/ImageJ
In the search area (lower-right of Fiji’s window), start typing
siy-convert-format
until the macro shows up.Launch the macro.
Launching the macro should open a new window, divided in three sections: I/O, Data and Order.
In the I/O section, select your input folder (the folder containing your original images with the inproper format) and your output folder (an empty folder that will receive the converted images).
In the Data section, fill the extension used by your images with the dot (ex: .czi, .nd)
In the Order section, fill the order in which your channels are when you open an image. If you don’t have one of the proposed channels (like the nuclei marking for example), leave the field empty (with a “-“).
Verify a last time your settings and click on the “Launch conversion!” button.