Ejemplo n.º 1
0
def splitImg():

    for t in dirtype:
        imgdir = TIFF3D.open(t + "-volume.tif")
        imgarr = imgdir.read_image()
        for i in range(imgarr.shape[0]):
            imgname = t + "/" + str(i) + ".tif"
            img = TIFF.open(imgname, 'w')
            img.write_image(imgarr[i])
Ejemplo n.º 2
0
def merge_img():
    '''
	merge single tif into a tif volume
	'''

    path = '/home/zhixuhao/Downloads/imgs_mask_test_server2/'
    imgdir = TIFF3D.open("test_mask_volume_server2.tif", 'w')
    imgarr = []
    for i in range(30):
        img = TIFF.open(path + str(i) + ".tif")
        imgarr.append(img.read_image())
    imgdir.write_image(imgarr)
Ejemplo n.º 3
0
def split_img():
    '''
    split a tif volume into single tif
    '''

    for t in dirtype:
        imgdir = TIFF3D.open(t + "-volume.tif")
        imgarr = imgdir.read_image()
        for i in range(imgarr.shape[0]):
            imgname = t + "/" + str(i) + ".tif"
            img = TIFF.open(imgname, 'w')
            img.write_image(imgarr[i])
Ejemplo n.º 4
0
def merge_img():
    '''
    merge single tif into a tif volume
    '''

    path = '/home/greg/data/code/python3/UNet/unet/data/'
    imgdir = TIFF3D.open("test_mask_volume_server2.tif", 'w')
    imgarr = []
    for i in range(30):
        img = TIFF.open(path + str(i) + ".tif")
        imgarr.append(img.read_image())
    imgdir.write_image(imgarr)
Ejemplo n.º 5
0
def merge_img():
	
	'''
	merge single tif into a tif volume
	'''

	path = '/home/zhixuhao/Downloads/imgs_mask_test_server2/'
	imgdir = TIFF3D.open("test_mask_volume_server2.tif",'w')
	imgarr = []
	for i in range(30):
		img = TIFF.open(path + str(i) + ".tif")
		imgarr.append(img.read_image())
	imgdir.write_image(imgarr)
Ejemplo n.º 6
0
def merge_img():
    '''
    merge single tif into a tif volume
    '''


    path = '/home/greg/data/code/python3/UNet/unet/data/'
    imgdir = TIFF3D.open("test_mask_volume_server2.tif", 'w')
    imgarr = []
    for i in range(30):
        img = TIFF.open(path + str(i) + ".tif")
        imgarr.append(img.read_image())
    imgdir.write_image(imgarr)
Ejemplo n.º 7
0
def split_img():
    '''
    split a tif volume into single tif
    '''

    for t in dirtype:
        if os.path.isdir(t):
            shutil.rmtree(t)
            os.mkdir(t)
        else:
            os.mkdir(t)
        imgdir = TIFF3D.open(t + "-volume.tif")
        imgarr = imgdir.read_image()
        for i in range(imgarr.shape[0]):
            imgname = t + "/" + str(i) + ".tif"
            img = TIFF.open(imgname, 'w')
            img.write_image(imgarr[i])
Ejemplo n.º 8
0
Archivo: tif.py Proyecto: APhun/U-net
from libtiff import TIFF3D, TIFF
imgdir = TIFF3D.open("train-volume.tif")
imgarr = imgdir.read_image()
for i in range(imgarr.shape[0]):
    imgname = str(i) + ".tif"
    img = TIFF.open(imgname, 'w')
    img.write_image(imgarr[i])