can we apply pca on 4D data

asked 2017-11-20 10:26:57 -0500

AhmedSh3ban gravatar image

updated 2017-11-20 11:01:27 -0500

can we use OpenCv PCA function on 4D data (x,y,z,t)?

edit retag flag offensive close merge delete


I have not tried PCA with OpenCV, so I'm not certain if OpenCV accepts 4D input data. If it does not accept 4D data, you can always convert the 4D data to 3D data using Hopf mapping, or some other method.

That said, I can't see OpenCV not accepting 4D data, when 4D data types are built into the library (ie. Vec4f).

sjhalayka gravatar imagesjhalayka ( 2017-11-20 17:38:54 -0500 )edit

pca expects a 2d single channel matrix, where every feature of your dataset is a 1d row (e.g. a flattened 2d image).

again, please explain the nature of your 4d data, and what you want to achieve with the pca

berak gravatar imageberak ( 2017-11-21 01:22:54 -0500 )edit

My data is 4d (fmri 4d image) what I want to achieve with pca is to make dimension reduction

AhmedSh3ban gravatar imageAhmedSh3ban ( 2017-11-21 01:57:09 -0500 )edit

still, not enough information.

berak gravatar imageberak ( 2017-11-21 02:02:26 -0500 )edit

lets say i do MRI test and i want to know the active regions in the brain during that test. so it records the behavior of the brain till the end of the test. what i get from MRI test is a 4d data (3d image of the brain x time)so i do pre-processing on it using FSL tool to know where is the active regions in the brain and the output will be 4d data (3d brain with active regions x time). so now i need to extract the features using ICA but first i want to make dimension reduction with PCA.

AhmedSh3ban gravatar imageAhmedSh3ban ( 2017-11-21 02:28:51 -0500 )edit

thanks break for help. i got it now

AhmedSh3ban gravatar imageAhmedSh3ban ( 2017-11-21 02:48:46 -0500 )edit

your ICA works on 2d images, right ?

berak gravatar imageberak ( 2017-11-21 03:08:17 -0500 )edit

i don't know yet still want to learn more about ICA. but i think yes.

AhmedSh3ban gravatar imageAhmedSh3ban ( 2017-11-21 03:53:17 -0500 )edit