Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
ecerda
Posted - 03/11/2011 : 09:54:55 AM Origin Ver. and Service Release (Select Help-->About Origin): Ver 8.5.0 R1 Operating System: Windows XP
I have a matrixLayer with N matrix objects of size nRow rows x nCols columns (imported from H5 file). I need to rearrange the elements in such a way that all the first elements of the first column of each matrix object are placed in the first column of the first matrixobject, the second elements of the first column in the second column of the first matrixobject and so on. The new multidimensional matrix would have therefore have nRows matrix objects of size N rows x nCols. In other words, I need to rotate the 4D matrix 90 deg arounbd the x axis (columns) such that the matrixobjects and the row indexes exchange: (nrow,ncol,N) -> (N,ncol,nrow).
I tried using 3 nested loops (rows, columns and matrixobject, with that hierachy) in which I define every time the matrixobject I need as a matrix and access the pixel individually and copy it to the new matrix.. this works, but it is too slow for the size of objects I have (200x200 pixels and 70 matrixobjects.)
I would be very grateful for some useful advice.
1 L A T E S T R E P L I E S (Newest First)
cpyang
Posted - 03/13/2011 : 08:08:20 AM Can you post the code? maybe a simplified version so we can see if there is a bottleneck that can be improved. Unless we add internal support for 4D rotation, I don't see a simple way to avoid pixel by pixel moving.