Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
malago86 committed Dec 23, 2020
1 parent f9a4e38 commit b04e2d5
Show file tree
Hide file tree
Showing 17 changed files with 361 additions and 36 deletions.
108 changes: 105 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,111 @@
## VICTRE PIPELINE DOCUMENTATION
# VICTRE PIPELINE DOCUMENTATION

**Author**: Miguel A. Lago

## DOCUMENTATION
## Documentation

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
Report your issues and requests here: https://github.com/malago86/VICTRE_PIPELINE

## Introduction

The Victre automated pipeline currently supports the following steps:
- Mass lesion generation (using [breastMass](https://github.com/DIDSR/breastMass))
- X-Ray Projection (using [VICTRE_MCGPU](https://github.com/DIDSR/VICTRE_MCGPU))
- DBT Reconstruction ([customized code](https://github.com/DIDSR/VICTRE/tree/master/FBP%20DBT%20reconstruction%20in%20C))
- Region of Interest extraction

## Example

### Step 1: Create the pipeline object
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 (use `localhost` if running in local machine)
- `gpu`: IP address for the GPU enabled node that will run the projection
- `cpu`: 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 extraction
- `results_folder`: Path to folder to be used when saving the results
- `spectrum_file`: path to a previously generated spectrum file in raw format
- `lesion_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 MCGPU
- `arguments_recon` Arguments to be overridden for the reconstruction algorithm
- `flatfield_file` Path to the flatfield file for projection

### Step 2: Insert lesions

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 types
- `n`: number of lesions to be inserted
- `roi_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.
### Step 3: Project and reconstruct

Simply call the following methods:
```
pline.project()
pline.reconstruct()
```

The process will take several minutes, depending on the speed and number of GPUs available.

### Step 4: Add absent regions of interest

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`.

### Step 5: Extract ROIs

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)
```

## Results

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` to `projection_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` and `output_mcgpu.out`
- **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` and `output_recon.out`
- **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
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<div id="navrow1" class="tabs">
<ul class="tablist">
<li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
Expand All @@ -62,7 +63,7 @@
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a></div>
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
Expand Down
7 changes: 7 additions & 0 deletions latex/md_README.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{\bfseries Author}\-: Miguel A. Lago

\subsection*{D\-O\-C\-U\-M\-E\-N\-T\-A\-T\-I\-O\-N}

You can find the documentation in this link\-: \href{https://malago86.github.io/victre_docs/annotated.html}{\tt https\-://malago86.\-github.\-io/victre\-\_\-docs/annotated.\-html}

Report your issues and requests here\-: \href{https://github.com/malago86/VICTRE_PIPELINE}{\tt https\-://github.\-com/malago86/\-V\-I\-C\-T\-R\-E\-\_\-\-P\-I\-P\-E\-L\-I\-N\-E}
11 changes: 11 additions & 0 deletions latex/md_Victre_breastMass_README_bm.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Breast Mass Generation Software

{\bfseries Documentation and installation instructions are available here\-:} \href{https://breastMass.readthedocs.io}{\tt breast\-Mass.\-readthedocs.\-io}.

The project is in the public domain within the United States, and copyright and related rights in the work worldwide are waived through the C\-C0 1.\-0 Universal public domain dedication. See the C\-O\-P\-Y\-I\-N\-G.\-txt file in this repository to view the entire C\-C0 dedication.

All contributions to this project will be released under the C\-C0 dedication. By submitting a pull request, you are agreeing to comply with this waiver of copyright interest.

\subsection*{Disclaimer}

This software and documentation (the \char`\"{}\-Software\char`\"{}) were developed at the Food and Drug Administration (F\-D\-A) by employees of the Federal Government in the course of their official duties. Pursuant to Title 17, Section 105 of the United States Code, this work is not subject to copyright protection and is in the public domain. Permission is hereby granted, free of charge, to any person obtaining a copy of the Software, to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, or sell copies of the Software or derivatives, and to permit persons to whom the Software is furnished to do so. F\-D\-A assumes no responsibility whatsoever for use by other parties of the Software, its source code, documentation or compiled executables, and makes no guarantees, expressed or implied, about its quality, reliability, or any other characteristic. Further, use of this code in no way implies endorsement by the F\-D\-A or confers any advantage in regulatory decisions. Although this software can be redistributed and/or modified freely, we ask that any derivative works bear some notice that they are derived from it, and any modified versions bear some notice that they have been modified.
10 changes: 7 additions & 3 deletions latex/refman.tex
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
\fancyhead[RO]{\fancyplain{}{\bfseries\thepage}}
\fancyfoot[LE]{\fancyplain{}{}}
\fancyfoot[CE]{\fancyplain{}{}}
\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Dec 11 2020 15\-:23\-:52 for Victre 2.\-0 Pipeline by Doxygen }}
\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated on Fri Dec 11 2020 15\-:23\-:52 for Victre 2.\-0 Pipeline by Doxygen }}
\fancyfoot[RE]{\fancyplain{}{\bfseries\scriptsize Generated on Mon Dec 21 2020 14\-:46\-:08 for Victre 2.\-0 Pipeline by Doxygen }}
\fancyfoot[LO]{\fancyplain{}{\bfseries\scriptsize Generated on Mon Dec 21 2020 14\-:46\-:08 for Victre 2.\-0 Pipeline by Doxygen }}
\fancyfoot[CO]{\fancyplain{}{}}
\fancyfoot[RO]{\fancyplain{}{}}
\renewcommand{\footrulewidth}{0.4pt}
Expand Down Expand Up @@ -120,7 +120,7 @@
\vspace*{1cm}
{\large Generated by Doxygen 1.8.5}\\
\vspace*{0.5cm}
{\small Fri Dec 11 2020 15:23:52}\\
{\small Mon Dec 21 2020 14:46:08}\\
\end{center}
\end{titlepage}
\clearemptydoublepage
Expand All @@ -132,6 +132,10 @@
%--- Begin generated contents ---
\chapter{Main Page}
\label{index}\hypertarget{index}{}\input{index}
\chapter{breast\-Mass}
\label{md_Victre_breastMass_README_bm}
\hypertarget{md_Victre_breastMass_README_bm}{}
\input{md_Victre_breastMass_README_bm}
%--- End generated contents ---

% Index
Expand Down
92 changes: 92 additions & 0 deletions md_README.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>Victre 2.0 Pipeline: VICTRE PIPELINE</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td style="padding-left: 0.5em;">
<div id="projectname">Victre 2.0 Pipeline
&#160;<span id="projectnumber">0.0.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">VICTRE PIPELINE </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p><b>Author</b>: Miguel A. Lago</p>
<h2>DOCUMENTATION</h2>
<p>You can find the documentation in this link: <a href="https://malago86.github.io/victre_docs/annotated.html">https://malago86.github.io/victre_docs/annotated.html</a></p>
<p>Report your issues and requests here: <a href="https://github.com/malago86/VICTRE_PIPELINE">https://github.com/malago86/VICTRE_PIPELINE</a> </p>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
5 changes: 1 addition & 4 deletions md_Victre_breastMass_README.html
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
Expand All @@ -65,7 +62,7 @@
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
Expand Down
Loading

0 comments on commit b04e2d5

Please sign in to comment.