Beispiel #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])
Beispiel #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)
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])
Beispiel #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)
Beispiel #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)
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)
Beispiel #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])
Beispiel #8
0
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])