Commit 655c7cd7 authored by Martinez-Carvajal German's avatar Martinez-Carvajal German
Browse files

I prefer python (not jython) scripts to do that

parent c6037f4b
def Cut_in_sections(Folder,Name_Image, sections):
# Number of divisions
# You should set a number of sections to create images of no more than 1GB
from ij import IJ
from import FileSaver
# Opening Image as virtual stack
argument = "open=" + Folder + Name_Image"TIFF Virtual Stack...", argument);
# Getting number of slices
Imp = IJ.getImage()
Total_Slices = Imp.getNSlices()
for section in range(sections):
start = int(section /float(sections)*Total_Slices)+1
end = int((section+1)/float(sections)*Total_Slices)
print('end', end)
argument = "title=section" + str(section) + '.tif' + " duplicate" + " range=" + str(start) + '-' + str(end), "Duplicate...", argument)
Imp_section = IJ.getImage() # Points to imp the last image you have opened
fs = FileSaver(Imp_section)
filepath = Folder + "/Section" + str(section) + '.tif'
Folder = '/home/german.martinez-carvajal/Desktop/Test_divide_in_sections'
Name_Image = '/Test_division.tif'
sections = 7
Cut_in_sections(Folder,Name_Image, sections)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment