def METHOD_NAME(out_movie, db, axis,preserve_ratio=True):
	offsets=range(db.getLogicBox().p1[axis],db.getLogicBox().p2[axis],1)
	for I,offset in enumerate(offsets):
		logic_box=getSliceLogicBox(axis, offset)
		img=data.read(logic_box=logic_box)
		physic_box=db.getBounds(logic_box).toAxisAlignedBox()
		img,logic_box,=db.readSlice()
		# resize to preserve the right ratio
		if preserve_ratio:
			density=[float(logic_box.size()[I])/float(physic_box.size()[I]) for I in range(3)]
			max_density=max(density)
			num_pixels=[int(physic_box.size()[I] * max_density) for I in range(3)]
			perm=((1,2,0),(0,2,1),(0,1,2))
			X,Y=perm[axis][0],perm[axis][1]				
			new_size=(num_pixels[X],num_pixels[Y])
			img=cv2.resize(img,new_size)
		out_movie.writeFrame(SwapRedBlue(img))
	out_movie.release()