def METHOD_NAME(arr, fn, **params):
    if arr.ndim == 2:
        #fake a 3rd dimension
        #raise ValueError, "can only save 3d arrays"
        arr = arr[:,:,None]
    fp = open(fn, 'w+b')
    ifd_offsets=[]
    if arr.dtype == 'uint16':
        nptype = 'uint16'
        piltype = 'I;16'
    #elif arr.dtype == 'uint8':
    #    nptype = 'uint8'
    #    piltype = 'I;8'
    else:
        nptype = 'f'
        piltype = 'F'
    params["_debug_multipage"] = True
    for z in range(arr.shape[2]):
        ii = Image.fromarray(arr[:,:,z].astype(nptype), piltype)
        fp.seek(0,2) # go to end of file
        if z==0:
            # ref. PIL  TiffImagePlugin
            # PIL always starts the first IFD at offset 8
            ifdOffset = 8
        else:
            ifdOffset = fp.tell()
        ii.save(fp, format="TIFF", **params)
        if z>0: # correct "next" entry of previous ifd -- connect !
            ifdo = ifd_offsets[-1]
            fp.seek(ifdo)
            ifdLength = ii._debug_multipage.i16(fp.read(2))
            fp.seek(ifdLength*12,1) # go to "next" field near end of ifd
            fp.write(ii._debug_multipage.o32( ifdOffset ))
        ifd_offsets.append(ifdOffset)
    fp.close()