Countious binary output of a single column

background - i’ve purchased a commercial lic to get the higher resolution, my files are 4k 120fps (though a solution should work fine with free lic.)

what i’m trying to create : a X*Y file where resy =y, true_length =X of the video in
not opening a image for each frame but contentiously saving
one column frame of data to the same file -

I.E create a long slitscan image from a mov file

  • once in raw byte format i can use raw2tiff to put a proper header on it (tiff file should be ~1-2Gbyte)

i’m currently at a point where i’m getting the column, is it possible just to save the numpy.array() from a TOP or do i have to go though a CHOP …

Hi @ralphnev,

not sure how performant that is but you could do this in a Script TOP:

# me - this DAT
# scriptOp - the OP which is cooking

import numpy

# press 'Setup Parameters' in the OP to call this function to re-create the parameters.
def onSetupParameters(scriptOp):
	page = scriptOp.appendCustomPage('Column Recorder')
	p = page.appendToggle('Record', label='Record')
	return

# called whenever custom pulse parameter is pushed
def onPulse(par):
	return

record = 0
frameCount = 0
image = numpy.empty((1,1,4), dtype=numpy.float32)

def onCook(scriptOp):
	global record, frameCount, image
	# fetch the input as a numpy array


	if record == 0 and scriptOp.par.Record == 1:
		record = 1
		frameCount = 0
		input = scriptOp.inputs[0].numpyArray(delayed=True)
		image = numpy.array(input)
	elif record == 1 and scriptOp.par.Record == 1:
		frameCount += 1
		# append the input as a new column to the image array
		input = scriptOp.inputs[0].numpyArray(delayed=True)
		image = numpy.append(image, input, axis=1)
	elif record == 1 and scriptOp.par.Record == 0:
		record = 0
		frameCount = 0
		# save the image to a file
		
		# # # # # # your code here
			
		# reset image to empty
		image = numpy.empty((1,1,4), dtype=numpy.float32)

	# copy it into the top
	scriptOp.copyNumpyArray(image)
	return

If you think you might exceed the size possible for the videocard’s limit, you could skip the display as well…

cheers
Markus

sorry for the delay, but yes, - edit : figured it out … still needs some finessing but it works :wink:
IE.

                # # # # # # your code here
		image = numpy.delete(image,3,2) #delete alpha layer
		image *= 256 # or any coefficient 
		image2 = image2.astype(numpy.uint8)

		scriptOp.copyNumpyArray(image)
		scriptOp.save('c:/TEMP/long.tiff')