Torch FFT Rotation & Juillard23 IPCA #651
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1-Adding Torch for Faster FFT Rotation Mode
Fft rotation using
vip-fft
mode useNumpy
library. The use ofTorch
instead ofNumpy
consistently improves speed. Newimlib='torch-fft'
.Having Torch remains an optional dependency, and a check to determine whether or not Torch is installed has been implemented.Here are the differences between the Torch FFT and VIP FFT methods for 50 rotations of a cube. The time is measured in seconds. The third image shows the difference between both rotation methods. The use of
Torch
instead ofNumpy
consistently improves speed.FYI (NOT IN THIS COMMIT)- Torch with Built-in Rotation Method (Bilinear/Nearest) not faster than Open CV
Here are the differences between the Torch and OpenCV methods for 50 rotations of a cube, with time measured in seconds. The third image shows the difference between the two rotation methods. In this case, the use of OpenCV is better, hence, I did not included the option of using Torch Built-in Rotation Method in the commit.
2-Adding “Juillard23” Mode to IPCA
The
“Juillard23”
mode has been added to the IPCA mode, enabling users to utilize the implementation from Juillard et al. (2023/2024). This method has no additional options for significant signal extraction and works exclusively with Torch, making it faster but also more prone to propagating noise and disk flux. The mode can return a stim map and residual map if full-output is set to true. This option is only compatible with'ADI'
and'ARDI'
; an error is raised if the options do not match. Other parameters, such as imbil and interpolation, are ignored. This option only usesnit
,ncomp
,pup_mask_center_px
,cube_ref
,cube
, andangle_list
. In particular, the threshold is always set to 0, and STIM is only computed at the end and is not part of the iterative process. Installation of the GreeDS package (viapip install GreeDS
) is required for this option. GreeDS is now a new optional dependency of VIP.