This project was completed as a part of the CS5234 Advanced Parallel Computing course at Virginia Tech.
In this project, a GPU accelerated version of Non Local Means is developed.
The project was developed using Nvidia CUDA framework, C++ and Matlab.
- Nvidia GPU (Compute capability ≥ 5.0)
- Matlab 2015a or above (image preprocessing)
- Visual Studio 2017 (for building and running the experiments)
- Windows 10 (The source code is compatible with windows 10)
- Nsight Visual Studio Plugin
Visualizing the 51 slices of the 3D MR Image
CPU vs. GPU execution time
These instructions will help you get the project up and running in your local system. Please make sure that the aforementioned prerequisites are fulfilled.
-
First go to your ProjectFiles directory
- Inside the folder, run the script data_transform.m in Matlab.
- The script will read the ms_lesions.mat files and add Gaussian White Noise
- This script will generate input.bin binary file.
- The generated binary file will be parsed by C++ and CUDA code
-
Next, import the NLM_Cuda project in your Visual Studio IDE
- Open the host_code.cpp file.
- Change the path variable in the file to the exact location of your ProjectFiles directory
- By default, these standard command line arguments have been loaded in your VS project
f : local window Radius (local window dims - (2*f + 1) ^ 3)
t : search window Radius (search window dims - (2*t + 1) ^ 3)
s : standard deviation of the Gaussian kernel
h : standard deviation of the Gaussian Weighting function
x : x-dimension of image
y : y-dimension of image
z : z-dimension of image
-
Finally for building the project, follow these steps
- If you haven't already, please disable the Windows Timeout Detection & Recovery (TDR)
- Without this, Windows OS will shutdown kernel operating for more than 2 seconds.
- In your visual studio project, go to build > rebuild project
- If your build is successful, Run the project using Debug > Run without Debugging option
-
If you have made it so far, this is the final step
- When the execution of your code is complete, Go to your ProjectFiles directory
- Inside, you'll see that two new binary files output_cpu.bin and output_gpu.bin have been generated.
- Run the Matlab Script view_data.m
- You will be shown the 10th slice of Ground truth, Noisy,
CPU generated denosied image & GPU generated denoised image in order
-
For further experiments, you can modify the Matlab scripts in the ProjectFiles directory
- Several utility scripts have already been written for your convenience
This project is licensed under the Apache 2.0 LICENSE - see the LICENSE.md file for details
The author thanks his family and the open source community.