Welcome to the ZIMFLUX repository! ZIMFLUX is a fluorescence microscopy project that combines modulated excitation patterns with Point Spread Function (PSF) engineering. If you're specifically interested in the vectorial PSF model, you might want to explore our related repository, VectorialPSF.
For the development of ZIMFLUX, we leverage several powerful tools and functionalities from PhotonPy. These include fast spot detection and drift correction, enhancing the overall capabilities and precision of our project.
Before you begin, ensure you have the following prerequisites:
- Operating System: Windows (Tested on Windows 10)
- CUDA Compatible GPU: It's essential to have a CUDA compatible GPU (tested on NVIDIA GeForce GTX 980). You can find compatibility information here.
Follow these steps to install and set up the project:
-
Install Python:
- We recommend using Anaconda to manage Python environments. You can download Anaconda here.
-
Create a Virtual Environment:
- Create a virtual environment using Anaconda with the following commands:
conda create -n myenv anaconda python=3.8 conda activate myenv
- Create a virtual environment using Anaconda with the following commands:
-
Install Visual Studio 2019 Community Edition:
- Download and install Visual Studio 2019 Community Edition from here.
-
Extract External Libraries:
- Extract the external libraries from
cpp/external.zipso that thecppdirectory contains a folder called "external."
- Extract the external libraries from
-
Install CUDA Toolkit 11.3:
- Install CUDA Toolkit 11.3.
- Check the installation guide here.
-
Build SMLMLib:
- In Visual Studio, open the
smlm.slnsolution. - Set the build mode to "Release" and platform to "x64."
- Build the
SMLMLibproject.
- In Visual Studio, open the
-
Install Python Dependencies:
- Install the required Python packages by running:
pip install -r requirements.txt
- Install the required Python packages by running:
-
Install PyTorch:
- Install PyTorch with the following command:
pip install torch==1.11.0+cu113 torchvision==0.12.0+cu113 torchaudio==0.11.0 --extra-index-url https://download.pytorch.org/whl/cu113
- Install PyTorch with the following command:
-
Download Datasets:
- Download datasets from Surfdrive here.
-
Run the code on a 3D Nanoruler Dataset:
- Change the 'absolute path to data' and 'absolute path to gain and offset data' to match the location where you stored the downloaded files from Surfdrive.
- You should now be able to run the script
ZIMFLUX/runfile.py.
-
Results
- Most figures are saved in the folder where the data is located. The .hdf5 files are compatible with Picasso.
If you encounter issues or the above steps do not yield the desired results, consider these fixes:
-
Check CUDA Installation:
- Run the following command in the terminal to check if CUDA is installed correctly:
nvidia-smi
- Run the following command in the terminal to check if CUDA is installed correctly:
-
Verify CUDA Availability with PyTorch:
- Open a Python interpreter and run the following commands to check if CUDA is detected by PyTorch:
import torch torch.cuda.is_available()
- Open a Python interpreter and run the following commands to check if CUDA is detected by PyTorch:
-
Ensure Correct CUDA Version:
- Verify that your CUDA version is compatible with your PyTorch version. Ensure you have CUDA 11.3 installed for compatibility.
-
Change CUDA Settings:
- Search for "NSight Monitor" and run it as an administrator.
- It may not open a new window but appear as a background process in the system tray (bottom right part of your screen).
- Right-click the NSight Monitor icon and go to 'Options.'
- Change 'WDDM TDR Delay' to '180' and 'WDDM TDR Enabled' to 'False.'
- You may need to reboot your system.
-
Update GPU Driver:
- Search for 'Device Manager.'
- Under 'Display adapters,' right-click your video card (usually NVIDIA XXXX).
- Click 'Properties' -> 'Driver' -> 'Update Driver...'
- Follow the prompts to update the GPU driver.
- You may need to reboot your system.
This project is licensed under the MIT license - see the LICENSE file for details.