[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.4 Rearrange
- Method on
mglData
(C++, Python):void
Rearrange (int
mx,int
my=0
,int
mz=0
) - C function:
void
mgl_data_rearrange (HMDT
dat,int
mx,int
my,int
mz) Rearrange dimensions without changing data array so that resulting sizes should be mx*my*mz < nx*ny*nz. If some of parameter my or mz are zero then it will be selected to optimal fill of data array. For example, if my=0 then it will be change to my=nx*ny*nz/mx and mz will be 1.
- Method on
mglData
(C++, Python):void
Extend (int
n1,int
n2=0
) - C function:
void
mgl_data_extend (HMDT
dat,int
n1,int
n2) Increase the dimensions of the data by inserting new (|n1|+1)-th slices after (for n1>0) or before (for n1<0) of existed one. It is possible to insert 2 dimensions simultaneously for 1d data by using parameter n2. Data to new slices is copy from existed one. For example, for n1>0 new array will be a_ij^new = a_i^old where j=0...n1. Correspondingly, for n1<0 new array will be a_ij^new = a_j^old where i=0...|n1|.
- Method on
mglData
(C++, Python):void
Transpose (const char *
dim="yx"
) - C function:
void
mgl_data_transpose (const char *
dim) Transposes (shift order of) dimensions of the data. New order of dimensions is specified int string dim. This function may be useful also for the reading of one-dimensional data.
- Method on
mglData
(C++, Python):void
Squeeze (int
rx,int
ry=1
,int
rz=1
,bool
smooth=false
) - C function:
void
mgl_data_squeeze (HMDT
dat,int
rx,int
ry,int
rz,int
smooth) Reduces the data size by excluding data elements which indexes are not divisible by rx, ry, rz correspondingly. Parameter smooth set to use smoothing (i.e. out[i]=\sum_{j=i,i+r} a[j]/r) or not (i.e. out[i]=a[j*r]).
- Method on
mglData
(C++, Python):void
Crop (int
n1,int
n2,char
dir='x'
) - C function:
void
mgl_data_crop (HMDT
dat,int
n1,int
n2,char
dir) Cuts off edges of the data i<n1 and i>n2 if n2>0 or i>
n[xyz]
-n2 if n2<=0 along direction dir.
- Method on
mglData
(C++, Python):void
InsertRows (int
at,int
num=1
,const char *
eq=NULL
) Insert num rows (slice along y-direction) at position at and fill it by formula eq (if eq!=0) or by zeros.
- Method on
mglData
(C++, Python):void
InsertColumns (int
at,int
num=1
,const char *
eq=NULL
) Insert num columns (slice along x-direction) at position at and fill it by formula eq (if eq!=0) or by zeros.
- Method on
mglData
(C++, Python):void
InsertSlices (int
at,int
num=1
,const char *
eq=NULL
) Insert num slices (slice along z-direction) at position at and fill it by formula eq (if eq!=0) or by zeros.
- Method on
mglData
(C++, Python):void
DeleteRows (int
at,int
num=1
) Delete num rows (slice along y-direction) at position at.
- Method on
mglData
(C++, Python):void
DeleteColumns (int
at,int
num=1
) Delete num columns (slice along x-direction) at position at.
- Method on
mglData
(C++, Python):void
DeleteSlices (int
at,int
num=1
) Delete num slices (slice along z-direction) at position at.
- Method on
mglData
(C++, Python):void
Insert (char
dir,int
pos=0
,int
num=1
) - C function:
void
mgl_data_insert (HMDT
dat,char
dir,int
pos,char
num) Insert num slices along dir-direction at position pos and fill it by zeros.
- Method on
mglData
(C++, Python):void
Delete (char
dir,int
pos=0
,int
num=1
) - C function:
void
mgl_data_delete (HMDT
dat,char
dir,int
pos,char
num) Delete num slices along dir-direction at position pos.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |