The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Rearrange MatrixLayer elements

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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.

CP


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000