This week i was doing several smaller things:
- Added some more commits to the read_curry function (which in my opinion is definitely ready to be merged now).
- Enhanced tests for the SourceTFR class, to push coverage to 89%.
- Further tried to get tfr_morlet() and source_induced_power() to produce a 100% equal data field.
For the last part i faced several problems. Often, the two named functions are not entirely equivalent. For Example, when SourceEstimates are created, the vector length is calculated from the x,y, and z components of each dipole. This is done with the plain old norm = sqrt(x**2 + y **2 + z **2). Since ready-made SourceEstimates are fed to TFR functions, this step is already performed when doing the time-frequency transform. Contrarily, when using source_induced_power, the norm is calculated after the TFR function. Since tfr(norm(data)) and norm(tfr(data)) are not equivalent in this case, i had to use VectorSourceEstimates instead. For VectorSourceEstimates, the x y and z components are returned separately and allow separate data handling.
Although the data looks more similar when performing TFR functions for each component of the VectorSourceEstimate and then calculating the norm, there are still various other steps that may cause slight differences in the data. After trying to handle some of them i decided for my next steps to go through the entire functions from start to end, and check where they vary in calculations.
So, that's going to be an intensive task, but i hope it will work out fine.
Stay tuned and see you next week!