Skip to content

adwaye/test_ct

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Data

Raw Data

  1. The raw CT scans can be found under Data/ct_scans. There are two folders, each corresponding to two different CT scans.
  2. Masks for artefacts can be found under artcon_DE_CTPA_1_5_Bv38_2_F_0.nrrd or pe_DE_CTPA_1_5_Bv38_2_F_0.nrrd .
  3. The raw CT scan is saved under DE_CTPA_1_5_Bv38_2_F_0.nrrd
  4. To convert the .nrrd files to .mat one can run the script called nrrd_to_mat_files.py.
  5. To analyse the data, the ct scans need to be converted to 2d slices, which can be done by running nrrd_to_mat_files.py.

Slice Data

  1. The slice data can be found in Data/ct_scans/ct1.
  2. They are saved as .mat files with fields CT and labels
  3. The labels are 2d arrays that are zero where the structure is not present in the image. They need to be converetd to a binary mask.

Code

Matlab Code

experiments_gradM_M.m

The main file is called experiments_gradM_M.m. The input is a slice data .mat file that have fields CT, texture_mask and labels with both arrays being the same size. These can be found under Data/ct_scans/ct1. These were made from the slices created by running nrrd_to_mat_files.py by adding a new field called texture_mask. This represents an area in the image whose pixel intensity should have the same distribution as the pixel intensity inside the area where the arteafact is found. texture_mask is used to set the radii of the balls that define the set $\mathcal{S}$.

Running experiments_gradM_M.m will iterate through a user defined list of detector setups (different noise and number of angles), radii for the balls defining the set $\mathcal{S}$. These are defined by the quantiles of the pixel distribution at texture_mask. The results of the forward map simulation for each detector/noise set up is saved in the results_path created in experiments_gradM_M.m as well as the resuls of the BUQO simulation for each detector setup and pixel quantile used to define the radii of the balls definning the setv $\mathcal{S}$. The file names will reflect the setups used.

The result_path will be found under Figures and will be named after the types of norm used to define the balls bounding the energy of the gradient and intensity of the image within the artefact location

inspect_xmap.m

This script will display the map estimate for the specified slice with name slice_name which was simulated using noise levels and number of angles that are specified by the user in the scipt (line 43 at writing this guide).

The user then has the choice to define a texture_mask and an artefact mask by adding an if statement as the ones present as from line 79, and saving a .mat file with entries 'xmap','fid','reg','norm_it','snr_it','time_it','time_total',... 'texture_mask','mask_struct','im_true','CT' where the 'mask_struct' shows the location of the artefact the user detected in the xmap, and 'texture_mask' shows an area whose pixel intensity will drive the radii of the balls defininf the set $\mathcal{S}$. This is saved under Data/aretfacts

test_artefact.m

This script uses the output from inspect_xmap.m to run BUQO on the artefacts whose location and sampled pixels are defined by mask_struct and texture_mask in the .mat files saved at Data/aretfacts. The output is saved under Figures/[folder_name] where [folder_name] has naming convention artefact_[Lx_gradM_Lx_M].

Python Code

nrrd_to_mat_files.py

The main function reads all nrrd files in a location containing nrrd files specified in the raw data section and converts them into a .mat.

The loop specified in the file will iterate through slices of the specified raw CT scan and a corresponding .nrrd files corresponding to a mask and save the label-image pair in a .mat file as 2d slices.

Experiments.ipynb

This is a jupyter notebook that reads the output of the BUQO algorithm from the specified folder and converts the metrics and results in a panadas dataframe. The pandas dataframe can then be used to plot the different results for publication/presentations.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors