bart squeeze
#
==============================================================================================================
The bart squeeze
command in BART is used to remove singleton dimensions (dimensions with size 1) from arrays. This is often necessary in array processing and image reconstruction tasks where extra dimensions may appear due to data manipulation, but they do not contain any additional information.
Where we can view the full usage string and optional arguments with the -h
flag.
!bart squeeze -h
Usage: squeeze <input> <output>
Remove singleton dimensions of array.
-h help
Example for Matrix (using Bash)#
Create a Matrix Filled with the Value of 1, Dimension as 3 x 1 x 2#
!bart ones 3 3 1 2 matrix
!bart show matrix
+1.000000e+00+0.000000e+00i +1.000000e+00+0.000000e+00i +1.000000e+00+0.000000e+00i
+1.000000e+00+0.000000e+00i +1.000000e+00+0.000000e+00i +1.000000e+00+0.000000e+00i
!bart show -m matrix
Type: complex float
Dimensions: 16
AoD: 3 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1
We can see the dimension for our matrix is 3 x 1 x 2
Remove singleton dimensions of the matrix that we created.#
!bart squeeze matrix matrix_squeeze
!bart show -m matrix_squeeze
Type: complex float
Dimensions: 16
AoD: 3 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1
We can see the dimension for our queeze_matrix became 3 x 2