Author: Miguel A. Lago
You can find the documentation in this link: https://malago86.github.io/victre_docs/annotated.html
Report your issues and requests here: https://github.com/malago86/VICTRE_PIPELINE
The Victre automated pipeline currently supports the following steps:
- Mass lesion generation (using breastMass)
- X-Ray Projection (using VICTRE_MCGPU)
- DBT Reconstruction (customized code)
- Region of Interest extraction
To start a new pipeline object use this function:
import Victre
pline = Victre.Pipeline(ip={"cpu": CPU_IP, "gpu": GPU_IP},
phantom_file=PHANTOM_FILE)
ip
: dictionary with the following two fields (uselocalhost
if running in local machine)gpu
: IP address for the GPU enabled node that will run the projectioncpu
: IP address for a computing node
phantom_file
: path to a previously generated voxelized phantom in raw format
Optional parameters:
seed
: random seed used for the lesion insertion and ROI extractionresults_folder
: Path to folder to be used when saving the resultsspectrum_file
: path to a previously generated spectrum file in raw formatlesion_file
Path to file containing the lesion to be inserted (in HDF5 format)materials
Dictionary including the materials to be used during projection (see Constants for an example of this dictionary)arguments_mcgpu
Arguments to be overridden for the projection in MCGPUarguments_recon
Arguments to be overridden for the reconstruction algorithmflatfield_file
Path to the flatfield file for projection
Create the region of interest dictionary for the lesions you want to insert:
roi_sizes = {Constants.VICTRE_SPICULATED: [109, 109, 9],
Constants.VICTRE_CLUSTERCALC: [65, 65, 5]}
Call the insert_lesions
method:
pline.insert_lesions(lesion_type=Constants.VICTRE_SPICULATED,
n=2,
roi_sizes=roi_sizes)
lesion_type
: see Constants for a list of available lesion typesn
: number of lesions to be insertedroi_sizes
: dictionary with the size of the regions of interest for each lesion
If the number of lesions is too high or the lesion size is too large, the insertion might not be successful.
Simply call the following methods:
pline.project()
pline.reconstruct()
The process will take several minutes, depending on the speed and number of GPUs available.
If you want to extract regions of interest without any lesion, call the add_absent_ROIs
method:
pline.add_absent_ROIs(lesion_type=Constants.VICTRE_SPICULATED,
n=2,
roi_sizes=roi_sizes)
Parameters and conditions are the same as for insert_lesions
.
To extract the ROIs and save them, use the method save_ROIs
with the dictionary for the roi_sizes
to be used for each type of lesion inserted.
save_ROIs(roi_sizes=roi_sizes)
The Victre pipeline saves the results of each step this way:
- Insertion: Results from the lesion insertion will be saved in the
phantom
subfolder as:- One gzip compressed raw file containing the voxelized phantom
- One text file (extension
.loc
) with the locations coordinates in the original phantom for each lesion and the lesion type (negative lesion types are for absent regions of interest)
- Projection: Results from the projection will be saved in the
results
folder in their corresponding seed folder:- A number of projection raw files from
projection_0001.raw
toprojection_0025.raw
(or the number of projections requested) - One projection corresponding to the digital mammography projection
projection_0000.raw
- The input and output file for the MCGPU software
input_mcgpu.in
andoutput_mcgpu.out
- A number of projection raw files from
- Reconstruction: Results from the reconstruction will be saved along the results from the projection:
- One file
reconstruction.raw
with the results from the reconstruction software for the DBT image - One file
projection_3000x1500pixels_25proj.raw
that is all the stacked projection slices - The input and output file for the reconstruction software
input_recon.in
andoutput_recon.out
- One file
- ROI: Results from the ROI extraction will be saved in two different ways along with the other result files:
- All the ROIs together saved as an HDF5 file
ROIs.h5
- Each ROI saved in raw format inside the
ROIs
subfolder
- All the ROIs together saved as an HDF5 file