Menu

Tree [ab0fdf] main /
 History

HTTPS access


File Date Author Commit
 graphics 2023-09-07 binibica binibica [726e26] INITIALIZE
 resource 2023-09-07 binibica binibica [726e26] INITIALIZE
 utils 2023-09-07 binibica binibica [726e26] INITIALIZE
 widgets 2023-09-07 binibica binibica [726e26] INITIALIZE
 README.html 2023-09-07 binibica binibica [726e26] INITIALIZE
 README.md 2023-09-07 BahramJafrasteh BahramJafrasteh [ab0fdf] Update README.md
 copyright.png 2023-09-07 binibica binibica [726e26] INITIALIZE
 main.ico 2023-09-07 binibica binibica [726e26] INITIALIZE
 melage.py 2023-09-07 binibica binibica [726e26] INITIALIZE

Read Me

<!doctype html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<style type="text/css">
# ~/.config/ReText project/github.css

body
{
    font-size:12pt;
    line-height:1.7;
    overflow-x:hidden;

    font-family: Helvetica, arial, freesans, clean, sans-serif;
    width: 80%;
    margin: 0 auto;
}

body>:first-child
{
  margin-top:0!important;
}

body>:last-child
{
  margin-bottom:0!important;
}

blockquote,dl,ol,p,pre,table,ul {
  border: 0;
  margin: 15px 0;
  padding: 0;
}

body a {
  color: #4183c4;
  text-decoration: none;
}

body a:hover {
  text-decoration: underline;
}

body a.absent
{
  color:#c00;
}

body a.anchor
{
  display:block;
  padding-left:30px;
  margin-left:-30px;
  cursor:pointer;
  position:absolute;
  top:0;
  left:0;
  bottom:0
}

body h1,body h2,body h3,body h4,body h5,body h6{
  margin:1em 0 15px;
  padding:0;
  font-weight:bold;
  line-height:1.7;
  cursor:text;
  position:relative
}

body h1:hover a.anchor,body h2:hover a.anchor,body h3:hover a.anchor,body h4:hover a.anchor,body h5:hover a.anchor,body h6:hover a.anchor{
  text-decoration:none;
  line-height:1;
  padding-left:0;
  margin-left:-22px;
  top:15%
}

body h1:hover a.anchor .octicon-link,body h2:hover a.anchor .octicon-link,body h3:hover a.anchor .octicon-link,body h4:hover a.anchor .octicon-link,body h5:hover a.anchor .octicon-link,body h6:hover a.anchor .octicon-link{
  display:inline-block
}

body h1 tt,body h1 code,body h2 tt,body h2 code,body h3 tt,body h3 code,body h4 tt,body h4 code,body h5 tt,body h5 code,body h6 tt,body h6 code{
  font-size:inherit
}

body h1{
  font-size:2.5em;
  border-bottom:1px solid #ddd
}

body h2{
  font-size:2em;
  border-bottom:1px solid #eee
}

body h3{
  font-size:1.5em
}

body h4{
  font-size:1.2em
}

body h5{
  font-size:1em
}

body h6{
  color:#777;
  font-size:1em
}

body p{
  font-size:12pt;
}

body p,body blockquote,body ul,body ol,body dl,body table,body pre{
  margin:15px 0
}

body h1 tt,body h1 code,body h2 tt,body h2 code,body h3 tt,body h3 code,body h4 tt,body h4 code,body h5 tt,body h5 code,body h6 tt,body h6 code
{
  font-size:inherit;
}

body li{
  font-size:12pt;
}

body li p.first
{
  display:inline-block;
}

body ul,body ol
{
  padding-left:30px;
}

body ul.no-list,body ol.no-list
{
  list-style-type:none;
  padding:0;
}

body ul ul,body ul ol,body ol ol,body ol ul
{
  margin-bottom:0;
  margin-top:0;
}

body dl
{
  padding:0;
}

body dl dt
{
  font-size:12pt;
  font-style:italic;
  font-weight:700;
  margin-top:15px;
  padding:0;
}

body dl dd
{
  margin-bottom:15px;
  padding:0 15px;
}

body blockquote
{
  border-left:4px solid #DDD;
  color:#777;
  padding:0 15px;
}

body blockquote>:first-child
{
  margin-top:0;
}

body blockquote>:last-child
{
  margin-bottom:0;
}

body table
{
  display:block;
  overflow:auto;
  width:100%;
}

body table th
{
  font-weight:700;
}

body table th,body table td
{
  border:1px solid #ddd;
  padding:6px 13px;
}

body table tr
{
  background-color:#fff;
  border-top:1px solid #ccc;
}

body img
{
  -moz-box-sizing:border-box;
  box-sizing:border-box;
  max-width:100%;
}

body span.frame
{
  display:block;
  overflow:hidden;
}

body span.frame>span
{
  border:1px solid #ddd;
  display:block;
  float:left;
  margin:13px 0 0;
  overflow:hidden;
  padding:7px;
  width:auto;
}

body span.frame span img
{
  display:block;
  float:left;
}

body span.frame span span
{
  clear:both;
  color:#333;
  display:block;
  padding:5px 0 0;
}

body span.align-center
{
  clear:both;
  display:block;
  overflow:hidden;
}

body span.align-center>span
{
  display:block;
  margin:13px auto 0;
  overflow:hidden;
  text-align:center;
}

body span.align-center span img
{
  margin:0 auto;
  text-align:center;
}

body span.align-right
{
  clear:both;
  display:block;
  overflow:hidden;
}

body span.align-right>span
{
  display:block;
  margin:13px 0 0;
  overflow:hidden;
  text-align:right;
}

body span.align-right span img
{
  margin:0;
  text-align:right;
}

body span.float-left
{
  display:block;
  float:left;
  margin-right:13px;
  overflow:hidden;
}

body span.float-left span
{
  margin:13px 0 0;
}

body span.float-right
{
  display:block;
  float:right;
  margin-left:13px;
  overflow:hidden;
}

body span.float-right>span
{
  display:block;
  margin:13px auto 0;
  overflow:hidden;
  text-align:right;
}

body code,body tt
{
  background-color:#f8f8f8;
  border:1px solid #ddd;
  border-radius:3px;
  margin:0 2px;
  padding:0 5px;
}

body code
{
  white-space:nowrap;
}


code,pre{
  font-family:Consolas, "Liberation Mono", Courier, monospace;
  font-size:11pt;
}

body pre>code
{
  background:transparent;
  border:none;
  margin:0;
  padding:0;
  white-space:pre;
}

body .highlight pre,body pre
{
  background-color:#f8f8f8;
  border:1px solid #ddd;
  font-size:11pt;
  line-height:19px;
  overflow:auto;
  padding:6px 10px;
  border-radius:3px
}

body pre code,body pre tt
{
  background-color:transparent;
  border:none;
  margin:0;
  padding:0;
}

body .task-list{
  list-style-type:none;
  padding-left:10px
}

.task-list-item{
  padding-left:20px
}

.task-list-item label{
  font-weight:normal
}

.task-list-item.enabled label{
  cursor:pointer
}

.task-list-item+.task-list-item{
  margin-top:5px
}

.task-list-item-checkbox{
  float:left;
  margin-left:-20px;
  margin-top:7px
}


.highlight{
  background:#ffffff
}

.highlight .c{
  color:#999988;
  font-style:italic
}

.highlight .err{
  font-weight:bold
  border: none !important;
}

.highlight .k{
  font-weight:bold
}

.highlight .o{
  font-weight:bold
}

.highlight .cm{
  color:#999988;
  font-style:italic
}

.highlight .cp{
  color:#999999;
  font-weight:bold
}

.highlight .c1{
  color:#999988;
  font-style:italic
}

.highlight .cs{
  color:#999999;
  font-weight:bold;
  font-style:italic
}

.highlight .gd{
  color:#000000;
  background-color:#ffdddd
}

.highlight .gd .x{
  color:#000000;
  background-color:#ffaaaa
}

.highlight .ge{
  font-style:italic
}

.highlight .gr{
  color:#aa0000
}

.highlight .gh{
  color:#999999
}

.highlight .gi{
  color:#000000;
  background-color:#ddffdd
}

.highlight .gi .x{
  color:#000000;
  background-color:#aaffaa
}

.highlight .go{
  color:#888888
}

.highlight .gp{
  color:#555555
}

.highlight .gs{
  font-weight:bold
}

.highlight .gu{
  color:#800080;
  font-weight:bold
}

.highlight .gt{
  color:#aa0000
}

.highlight .kc{
  font-weight:bold
}

.highlight .kd{
  font-weight:bold
}

.highlight .kn{
  font-weight:bold
}

.highlight .kp{
  font-weight:bold
}

.highlight .kr{
  font-weight:bold
}

.highlight .kt{
  color:#445588;
  font-weight:bold
}

.highlight .m{
  color:#009999
}

.highlight .s{
  color:#d14
}

.highlight .n{
  color:#333333
}

.highlight .na{
  color:#008080
}

.highlight .nb{
  color:#0086B3
}

.highlight .nc{
  color:#445588;
  font-weight:bold
}

.highlight .no{
  color:#008080
}

.highlight .ni{
  color:#800080
}

.highlight .ne{
  color:#990000;
  font-weight:bold
}

.highlight .nf{
  color:#990000;
  font-weight:bold
}

.highlight .nn{
  color:#555555
}

.highlight .nt{
  color:#000080
}

.highlight .nv{
  color:#008080
}

.highlight .ow{
  font-weight:bold
}

.highlight .w{
  color:#bbbbbb
}

.highlight .mf{
  color:#009999
}

.highlight .mh{
  color:#009999
}

.highlight .mi{
  color:#009999
}

.highlight .mo{
  color:#009999
}

.highlight .sb{
  color:#d14
}

.highlight .sc{
  color:#d14
}

.highlight .sd{
  color:#d14
}

.highlight .s2{
  color:#d14
}

.highlight .se{
  color:#d14
}

.highlight .sh{
  color:#d14
}

.highlight .si{
  color:#d14
}

.highlight .sx{
  color:#d14
}

.highlight .sr{
  color:#009926
}

.highlight .s1{
  color:#d14
}

.highlight .ss{
  color:#990073
}

.highlight .bp{
  color:#999999
}

.highlight .vc{
  color:#008080
}

.highlight .vg{
  color:#008080
}

.highlight .vi{
  color:#008080
}

.highlight .il{
  color:#009999
}

.highlight .gc{
  color:#999;
  background-color:#EAF2F5
}

.type-csharp .highlight .k{
  color:#0000FF
}

.type-csharp .highlight .kt{
  color:#0000FF
}

.type-csharp .highlight .nf{
  color:#000000;
  font-weight:normal
}

.type-csharp .highlight .nc{
  color:#2B91AF
}

.type-csharp .highlight .nn{
  color:#000000
}

.type-csharp .highlight .s{
  color:#A31515
}

.type-csharp .highlight .sc{
  color:#A31515
}

body kbd {
  font-size: 11px;
  color: #444d56;
  background-color: #fafbfc;
  border: 1px solid #c6cbd1;
  border-bottom-color: #959da5;
  border-radius: 3px;
  box-shadow: inset 0 -1px 0 #959da5;
  padding:3px 5px;
}
</style>
<meta name="generator" content="ReText 7.2.3">
<title>README</title>
<style type="text/css">
</style>
</head>
<body>
<style>
td, th {
   border: none!important;
}
</style>

<p align="center">
<img src="resource/main.ico" alt="MELAGE" style="border:1px solid black" object-fit="contain" width="400"/><br>
<font size="4"> MELAGE</font> 
</p>

<h1>Table of contents</h1>
<ul>
<li><a href="#dependencies">Dependencies</a></li>
<li><a href="#installation">Installation</a></li>
<li><a href="#manual">How to use</a></li>
<li><a href="#toolbars">Toolbars</a></li>
<li><a href="#widgets">Widgets</a></li>
<li><a href="#tabs">Tabs</a></li>
<li><a href="#tools">Tools</a></li>
<li><a href="#license">License</a></li>
<li><a href="#releases">Releases</a></li>
<li><a href="#citation-and-acknowledgements">Citation and acknowledgements</a></li>
</ul>
<h2>Dependencies</h2>
<p>This software depends on the following libraries:</p>
<pre><code>matplotlib==3.6.1 
nibabel==4.0.2
numba==0.56.4
numpy==1.23.3
opencv_python_headless==4.6.0.66
pickle5==0.0.11
Pillow==9.2.0
Pillow==10.0.0
pydicom==2.3.1
pyFFTW==0.13.0
PyOpenGL==3.1.6
PyOpenGL==3.1.7
PyQt5==5.15.9
PyQt5_sip==12.11.0
qtwidgets==0.18
scikit_image==0.19.3
scikit_learn==1.1.2
scipy==1.11.2
SimpleITK==2.2.0
SimpleITK==2.2.1
surfa==0.4.2
torch==1.12.1+cu116
trimesh==3.17.0
vtk==9.2.2
</code></pre>
<h2>Installation</h2>
<h4>Windows and linux</h4>
<p>It is very easy to install melage on pc and laptop 
1. clone library</p>
<pre><code class="language-sh">git clone [https://github.com/bahramjafrasteh/melage](https://github.com/bahramjafrasteh/melage) &lt;br&gt;
</code></pre>
<ol>
<li>install requirements</li>
</ol>
<pre><code class="language-sh">pip install -r requirements.txt
</code></pre>
<ol>
<li>run melage</li>
</ol>
<pre><code class="language-sh">python melage.py
</code></pre>
<hr>
<h2>Manual</h2>
<h2><strong> main page<br></h2>
<p>This is the main window that appears after running melage.</p>
<blockquote>
<ul>
<li>To continue, you need to create a new project or load previously saved project</li>
<li>The default format for the projects are ".bn"</li>
</ul>
</blockquote>
<p align="center">
<img src="resource/manual_images/main_page.png" alt="MELAGE" width="800" style="border:1px solid black" object-fit="contain"/><br>
<font size="4"> main window</font> 
</p>

<h1>Toolbars</h1>
<h2><strong> 1. Project toolbar</h2>
<p>On the most top left of the page you find these three options from left to right:<br></p>
<blockquote>
<ul>
<li>Create new project: It is used to create a new project in order to open a new image file.</li>
<li>load a project: It is used to load a previously saved project with all of the changes. It helps to do not loose your previous work.</li>
<li>save: This button is used to save current porject if there is any project. It can overwrite the same project.<br></li>
</ul>
</blockquote>
<p>These options are also available through:</p>
<blockquote>
<ul>
<li>File -&gt; new project</li>
<li>File -&gt; load project</li>
<li>File -&gt; save</li>
</ul>
</blockquote>
<p align="center">
<img src="resource/manual_images/open_save_load.png" alt="MELAGE" width="200" style="border:1px solid black" object-fit="contain"/><br>
<font size="2"> from left to right: Create new project, load a project and save</font> 
</p>
<p><br></p>
<h2><strong> 2. image toolbar<br></h2>
<p>In the right hand side of the project toolbar there is image toolbar to load two images at the same time. <br>
From left to right</p>
<blockquote>
<ul>
<li>Open <strong><em>ultrasound</em></strong> image: The default of this button is to open ultrasound image (some times referred as top image). You can open ultrasound or MRI image using this option</li>
<li>Open <strong><em>MRI</em></strong> image: The default is to open an MRI image. It can be used to open both MRI and Ultrasound image</li>
</ul>
</blockquote>
<p float="left" align="center">
<img src="resource/manual_images/load_image_file.png" alt="MELAGE" width="200" style="border:1px solid black" object-fit="contain"/>
<img src="resource/manual_images/load_image_file_openp.png" alt="MELAGE" width="200" style="border:1px solid black" object-fit="contain"/><br>
<font size="2"> Open image toolbar left: There is no project. Right: A project has been loaded</font> 
</p>
<p><br></p>
<h2><strong> 3. Tools toolbar</h2>
<p>In the top left hand side of MELAGE there are seven buttons divided in three sections<br>
From left to right:</p>
<ul>
<li>Build lines: To build different lines in the same slice and then crate a segmentation by connecting end of these lines. Later it has has been explained it in details.</li>
<li>Point selection: Locate the position of selected points in a slice.</li>
<li>Zoom in: Zooming inside both three/six windows at the same time</li>
<li>Zoom out: Zooming out both three/six windows at the same time</li>
<li>Measurement: Ruler tool to measure distance and length</li>
<li>Linking: To link sagittal, coronal and axial slices in the image. This option allows to find exact location of a point in other slices.</li>
<li>3D: This option allows apearance or dispearance of 3D widgets.</li>
</ul>
<p float="left" align="center">
<img src="resource/manual_images/toolbar_tools.png" alt="MELAGE" width="500" style="border:1px solid black" object-fit="contain"/><br>
<font size="4">Necessary tools toolbar</font> 
</p>

<h2><strong> 4. Panning toolbar</h2>
<p>Just below project toolbar there is panning toolbar that includes arrow and panning<br>
From left to right:</p>
<ul>
<li>Arrow: Arrow</li>
<li>Panning: Use to pan through a slice after or before zooming</li>
</ul>
<p float="left" align="center">
<img src="resource/manual_images/panning_toolbar.png" alt="MELAGE" width="200" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">Panning toolbar</font> 
</p>

<h2><strong> 5. Segmentation toolbar</h2>
<p>In the right hand side of panning toolbar there is segmentation toolbar. From left to right it includes:</p>
<ul>
<li>Eraser: To erase segmentation over the image</li>
<li>Eraser X times: To erase the same region multiple time from the next slices</li>
<li>Pen: To segment image with arbitrary shape in a closed area.</li>
<li>Contour: To draw a contour and segment everything inside it.</li>
<li>Contour X times: Same as contour but with multiple times</li>
<li>Circle: To segment a region based on a circle with adjustable radius.</li>
<li>Activated color: Shows the activated color that can be used for segmentation.</li>
<li>Color name: A text that shows the name of the activated color.</li>
</ul>
<p float="left" align="center">
<img src="resource/manual_images/segmentation_toolbar.png" alt="MELAGE" width="600" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">Segmentation toolbar</font> 
</p>

<h2><strong> 6. Exit toolbar</h2>
<p>From left to right:<br></p>
<ul>
<li>Logo: MELAGE/MELAGE+ logo</li>
<li>Exit: Exit button</li>
</ul>
<p align="center">
<img src="resource/manual_images/exit_toolbar.png" alt="MELAGE" width="300" style="border:1px solid black" object-fit="contain"/><br>
<font size="2"> Exit toolbar</font> 
</p>

<h1>Widgets</h1>
<h2>Color widget</h2>
<table>
<tr>
<td>

<p align="center">
<img src="resource/manual_images/widget_color.png" alt="MELAGE" width="750" style="border:1px solid black" object-fit="contain"/><br>
<font size="2"> Color </font> 
</p>

</td>
<td>
<p align="center">
<img src="resource/manual_images/widget_color_additional.png" alt="MELAGE" width="1000" style="border:1px solid black" object-fit="contain"/><br>
<font size="2"> Right click</font> 
</p>
</td>
<td>
<font size="5">
This feature can be used to show us different color combinations (LUT) for different structures in an image. The desired color can be activated and also can be searched for.</font> 
</td>
</tr>
</table>
<p>You can change the style as you want. Moreover you can add your custom style.
Currently suppported styles are from the following human brian atlases:</p>
<ul>
<li><a href="https://brain-development.org/brain-atlases/neonatal-brain-atlases/neonatal-brain-atlas-gousias/">Albert Neontal brain atlas</a></li>
<li><a href="https://osf.io/4vthr/">M-CRIB 2.0 neonatal brain atlas</a></li>
<li><a href="">Adult brain</a></li>
</ul>
<p>Moreover, thre are two tissue segmentations and one simple scheme.
One can easily import new style by clicking on import button.
The name of the lables can be changed.
A new label can be created by clicking on the color in the segmentation toolbar</p>
<p align="center">
<img src="resource/manual_images/widget_color_add.png" alt="MELAGE" width="300" style="border:1px solid black" object-fit="contain"/><br>
<font size="2"> Add a color</font> 
</p>
<p>A new color can be chosen here. Then, another windows will be opened as follows</p>
<p align="center">
<img src="resource/manual_images/widget_color_add2.png" alt="MELAGE" width="300" style="border:1px solid black" object-fit="contain"/><br>
<font size="2"> Add index and name</font> 
</p>
<p>In this windows the index of new color and its name should be chosen. If the index of a new color already exist it replaces the index of previously existing color.</p>
<h2>MRI widget</h2>
<table>
<tr>
<td>
<p align="center">
<img src="resource/manual_images/widget_mri.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">Widget MRI</font> 
</p>

</td>
<td>
<p align="center">
<img src="resource/manual_images/widget_mri2.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/><br>
<font size="2"> Widget MRI (continued)</font> 
</p>
</td>
</tr>
</table>

<p>Image enhancement widget including brightness, contrast improvement, bandpass filters, hamming filter and also sobel operator. There is an option to rotate image based on sagital, axil and coronal or their combinations. There is sagittal to coronal option to change the coronal and sagital for ultrasound images.</p>
<h2>table widget</h2>
<p align="center">
<img src="resource/manual_images/widget_table.png" alt="MELAGE" width="700" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">Widget table</font> 
</p>
<p>This table includes</p>
<pre><code>* Description: Additional description
* Image type: MRI (Bottom) or Ultrasound (Top)
* Measure 1: Surface or Length (ruler)
* Measure 2: Perimeter or Angle (ruler)
* Slice: Slice number
* Window name: Sagittal, Coronal or Axial
* CenterXY: Center position
* FileName: Name of the file
</code></pre>
<p align="center">
<img src="resource/manual_images/widget_table2.png" alt="MELAGE" width="300" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">Widget table</font> 
</p>
<p>Right click in the table widget can appear additional options:</p>
<pre><code>* Add: adding new row
* Edit: Editting current cell
* Export: export table to CSV file
* Remove: eliminating current row
</code></pre>
<h2>images widget</h2>
<p align="center">
<img src="resource/manual_images/widget_images.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">Widget images</font> 
</p>
<p>This includes a set of images (MRI, Ultrasound, etc.) and the corresponding segmentation that can be selected an loaded later if it is needed.
The image can be visulized if the icon is activated.
A segmentation file can not be loaded before loading an image.</p>
<p align="center">
<img src="resource/manual_images/widget_images2.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">Widget images</font> 
</p>
<p>Right click on this part can give access to</p>
<pre><code>* Import
    * Images: Importing images that can be MRI, Ultrasound, etc.
    * Segmentation: Importing segmentation file that can also be MRI, Ultrasound, etc.
* RemoveSelected: Removing selected file
* Clear All: Clear all non active images
</code></pre>
<p>Importing dialouge will be appear as follows</p>
<p align="center">
<img src="resource/manual_images/widget_images3.png" alt="MELAGE" width="800" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">Widget images</font> 
</p>
<p>The type of image file or segmentation file can be selected from this window. For example if "Neonatal" is selected the image is an ultrasound and for MRI files "MRI" option should be selected.
There is a preview option that can be used to preview an image before openning.</p>
<h2>Segmentation intensity widget</h2>
<p align="center">
<img src="resource/manual_images/widget_segintensity.png" alt="MELAGE" width="300" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">segmentation intensity</font> 
</p>
<p>This widget has been designed to intensify the intensity of the color in the segmented region. If the vaule is equal to zero, it does not show any segmentation.</p>
<h2>Marker size widget</h2>
<p align="center">
<img src="resource/manual_images/widget_marker.png" alt="MELAGE" width="300" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">segmentation intensity</font> 
</p>
<p>This widget has two parts from top to bottom:</p>
<ul>
<li>Incrase radius of the circle to segment regions</li>
<li>Incrase thickness of pen in contour segmentation</li>
</ul>
<h1>Tabs</h1>
<p>There are three tabs designed for MELAGE.</p>
<p align="center">
<img src="resource/manual_images/tabs.png" alt="MELAGE" width="800" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">segmentation intensity</font> 
</p>
<ul>
<li>Mutual view<ul>
<li>In this tab two images can be processed at the same time. In all images, the orders of the planes are coronal, sagittal and then axial. One can scroll over each plane separately.</li>
<li>The number above each plane is the slice number.</li>
<li>There is a letter in left, right, top and bottom of each plane. "S" stands for sagittal, "A" axial and "C" stands for coronal. 
 <p align="center">
<img src="resource/manual_images/widget_tab_mutualview.png" alt="MELAGE" width="800" style="border:1px solid black" object-fit="contain"/><br>
<font size="2">segmentation intensity</font> 
</p></li>
<li>One can segment each image and/or process images in this view.</li>
<li>The top part is reserved for Ultrasound images and thus named top image for the process.</li>
<li>The bottom images has been reserved for MRI images and named bottom image.</li>
<li>If one image is closed this tab just shows three planes of the first image as shown below.
 <p align="center">
<img src="resource/manual_images/widget_tab_mutualview2.png" alt="MELAGE" width="800" style="border:1px solid black" object-fit="contain"/><br>
</p></li>
</ul>
</li>
<li>Ultrasound segmentation<ul>
<li>This tabl has the following components:<ul>
<li>Image visulization and processing. It is ideal to see one plane in bigger size and concentrate on one plane while can see instantaneous 3D segmentation.</li>
<li>Horizontal slidebar: To scroll over slices in the selected plane.</li>
<li>Change planes (radio buttons): To select sagittal, axial or coronal slices in the image.</li>
<li>show seg (radio button): To visualize or do not show segmented regions.</li>
<li>3D visualization: 3D visualization is an important part of MELAGE that later will be explained in details.
 <p align="center"> 
<img src="resource/manual_images/tab_us.png" alt="MELAGE" width="800" style="border:1px solid black" object-fit="contain"/><br>
</p></li>
</ul>
</li>
</ul>
</li>
<li>MRI segmentation<ul>
<li>This tabl has the following components:<ul>
<li>Image visulization and processing. It is ideal to see one plane in bigger size and concentrate on one plane while can see instantaneous 3D segmentation.</li>
<li>Horizontal slidebar: To scroll over slices in the selected plane.</li>
<li>Change planes (radio buttons): To select sagittal, axial or coronal slices in the image.</li>
<li>show seg (radio button): To visualize or do not show segmented regions.</li>
<li>3D visualization: 3D visualization is an important part of MELAGE that later will be explained in details.
 <p align="center"> 
<img src="resource/manual_images/tab_mri.png" alt="MELAGE" width="800" style="border:1px solid black" object-fit="contain"/><br>
</p></li>
</ul>
</li>
</ul>
</li>
</ul>
<h1>3D Visualization</h1>
<p>Right click on this region give access to various options:</p>
<p align="center"> 
<img src="resource/manual_images/3D_rightc.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/><br>
</p>

<ul>
<li>
<p>GoTo : Activating it allows to go to the corresponding location in the image.</p>
<ul>
<li>
<p>The approximate location of mouse in 3D space will apear on the right bottom part of the 3D visualization</p>
<ul>
<li>The location of the selected point will appear in proper sagittal, coronal or axial plane according to the direction that is closest to this view.
<p align="center"> 
<img src="resource/manual_images/3D_rightc_goto.png" alt="MELAGE" width="700" style="border:1px solid black" object-fit="contain"/><br>
</p></li>
</ul>
</li>
<li>
<p>Segmentation: This option activate image segmentation visualization.</p>
<ul>
<li>tip: If you are in this tab to activate it you need to go to another tab and get back to it if it is needed.
<p align="center"> 
<img src="resource/manual_images/3D_rightc_seg.png" alt="MELAGE" width="700" style="border:1px solid black" object-fit="contain"/><br>
</p></li>
</ul>
</li>
<li>
<p>BG color: Change background color. You can select different background color for your 3D visualization.</p>
</li>
<li>
<p>Painting: It has various options:</p>
</li>
</ul>
</li>
</ul>
<p align="center"> 
<img src="resource/manual_images/3D_rightc_paint.png" alt="MELAGE" width="700" style="border:1px solid black" object-fit="contain"/><br>
</p>
<pre><code>    * Draw: It enables to draw in order to cut a part of 3D image.
&lt;p align="center"&gt;
&lt;img src="resource/manual_images/3D_rightc_paint_draw1.png" alt="MELAGE" width="700" style="border:1px solid black" object-fit="contain"/&gt;
&lt;/p&gt;
</code></pre>
<ul>
<li>Show total: To get back to orignal view without cut<br></li>
<li>Image render:  To render image in different colors. The segmentation intensity can help in better visulization.</li>
</ul>
<table>
<tr>
<td>
<p align="center">
<img src="resource/manual_images/3D_rightc_paint_render.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
<font size="2">Rainbow</font> 
</p>
</td>
<td>
<p align="center">
<img src="resource/manual_images/3D_rightc_paint_render2.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
<font size="2">Gray</font> 
</p>
</td>
<td>
<p align="center">
<img src="resource/manual_images/3D_rightc_paint_render3.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
<font size="2">Jet</font> 
</p>
</td>
</tr>
<tr>
<td>
<p align="center">
<img src="resource/manual_images/3D_rightc_paint_render4.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
<font size="2">Gnuplot</font> 
</p>
</td>
<td>
<p align="center">
<img src="resource/manual_images/3D_rightc_paint_render5.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
<font size="2">Gnuplot2</font> 
</p>
</td>
<td>
<p align="center">
<img src="resource/manual_images/3D_rightc_paint_render6.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
<font size="2">Original</font> 
</p>
</td>
</tr>
</table>

<ul>
<li>Axis: Show axis with 3D visulization</li>
<li>Grid: Show grid with 3D visulization</li>
</ul>
<h1>Tools</h1>
<h2>segmentation options using contour</h2>
<ul>
<li>selecting contour tools and right clicking on the segmented area can appear the following options:<ul>
<li>center: center of the segmented region</li>
<li>surface are of the segmented region</li>
<li>perimeter of the segmented region</li>
<li>send the above infomration to table</li>
<li>Add to interpolation: Add the current slice for slice to slice interpolation</li>
<li>Apply interpolation by adding the current slice to the interpolation</li>
</ul>
</li>
</ul>
<p align="center">
<img src="resource/manual_images/tools_seg.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
</p>
<h2>interpolation between slices</h2>
<p>To use this option:</p>
<ul>
<li>Activate desired colors that want to interpolate</li>
<li>select a segmented region in one of the planes (sagittal, axial or coronal)</li>
<li>add another region from other slice to the interpolation algorithm. You can add as mucch as want.</li>
<li>Right click on apply interpolation</li>
<li>wait until the interpolation results appear.</li>
</ul>
<h2>Ruler</h2>
<ul>
<li>Ruler has been designed to measure the distances between two points in an image. Before using it, ruler button should be pressed. Right click includes:<ul>
<li>Center position</li>
<li>Length</li>
<li>Line angle</li>
<li>Remove: eliminating current ruler</li>
<li>sending the information to the table</li>
</ul>
</li>
</ul>
<p align="center"> 
<img src="resource/manual_images/tools_ruler.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
</p>
<p>There are no limits for adding new ruler.</p>
<h2>Tools menu</h2>
<ul>
<li>In tools menu there are various options:<ul>
<li>Undo: To get back to previous segmentations (until 10 previous segmentation)</li>
<li>Redo: It is opposite of the undo (until 10 times)</li>
<li>Preprocessing: including N4 Bias Field Correction, Image Masking, BET, DeepBET, Image Thresholding, Masking Operation, Change CS.</li>
<li>Basic Info: including Image Histogram, Resize, Image Information.</li>
</ul>
</li>
</ul>
<p align="center"> 
<img src="resource/manual_images/tools_tools.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
</p>

<ul>
<li>N4 Bias Field Correction<ul>
<li>N4 Bias Field Correction by the help of SimpleITK library</li>
<li>The parameters are:<ul>
<li>Otsu : To use Otsu multiple thresholding to crate mask image.</li>
<li>Fiting level: Number of fitting</li>
<li>Shrinking factor: reduction factor</li>
<li>Max Iterations: Maximum number of iterations</li>
<li>On the bottom left : There is a combox to select the right image. Bottom image is MRI and top image stands for ultrasound image.</li>
<li>By clicking on apply the algorithm starts to work. As it is computational needs its time to finish. Do not worry if application is not working during this time.</li>
<li>After finishing the algoirhtm another button "Original" appears, which means you can get back to original image if you are not happy with the results.</li>
</ul>
</li>
</ul>
</li>
</ul>
<p align="center"> 
<img src="resource/manual_images/tools_n4b.png" alt="MELAGE" width="600" style="border:1px solid black" object-fit="contain"/>
</p>

<ul>
<li>Image Masking:<ul>
<li>This tool has been designed to remain with a part of image with respect to the segmentation.</li>
<li>From left to right and top to bottom:<ul>
<li>A combo box to select the right image. Bottom image is MRI and top image stands for ultrasound image.</li>
<li>A combo box (keep or remove): To keep or remove part of image according to selected masking color</li>
<li>Mask Color: The color used to mask image</li>
<li>Bottom right: To apply the masking on image</li>
</ul>
</li>
<li>To get back to original image, the masking color should be "9876_Combined".</li>
</ul>
</li>
</ul>
<p align="center"> 
<img src="resource/manual_images/tools_masking.png" alt="MELAGE" width="600" style="border:1px solid black" object-fit="contain"/>
</p>

<ul>
<li>Brain Extraction Tool<ul>
<li><a href="https://github.com/vanandrew/brainextractor">Brain Extraction Tools</a> proposed by</li>
</ul>
</li>
</ul>
<pre><code>Smith SM. Fast robust automated brain extraction. 
Hum Brain Mapp.2002 Nov;17(3):143-55. doi: 10.1002/hbm.10062. PMID: 12391568; PMCID: PMC6871816.
</code></pre>
<pre><code>*Its parameters are:
    * Advanced: To enable change default parameters
    * Iterations: Number of iterations
    * Adaptive thresholding: To enable automatically select lower and upper bound
    * Fractional Threshold: (see paper)
    * Search distance (see paper)
    * Radius of curvature (see paper)
</code></pre>
<p align="center"> 
<img src="resource/manual_images/tools_bet.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
</p>

<ul>
<li>Deep Learning Brain Extraction<ul>
<li>This tool includes deep learning based brain extraction tools</li>
<li>From top to bottom and from left to right<ul>
<li>Advanced : Enables editting </li>
<li>Image selection: To select proper image</li>
<li>Model selection: To select a deep learning model</li>
<li>Cuda: To enable GPU processing (it is not recommended except if you have a high capacity GPU)</li>
<li>Image type: MRI or Ultrasound</li>
<li>Threshold: The thresholding value (between -4 to 4)</li>
<li>Load Network Weights : To select path of network weights</li>
<li>Apply: To run the model</li>
<li>Tips: If you run the model and you are not satisfied with the results, you can change the threshold without needing to run the model again.</li>
</ul>
</li>
</ul>
</li>
</ul>
<p align="center"> 
<img src="resource/manual_images/tools_deepbet.png" alt="MELAGE" width="600" style="border:1px solid black" object-fit="contain"/>
</p>

<ul>
<li>Image Thresholding<ul>
<li>Image thresholding based on Multi-Otsu thresholding method.</li>
<li>From left to right<ul>
<li>Image selection</li>
<li>Number of classes : Number of classes for image thresholding</li>
<li>Apply: To execute the algorithm</li>
</ul>
</li>
</ul>
</li>
</ul>
<p align="center"> 
<img src="resource/manual_images/tools_threshold.png" alt="MELAGE" width="600" style="border:1px solid black" object-fit="contain"/>
</p>

<ul>
<li>
<p>Masking Operations</p>
<ul>
<li>To sum and subtract masking colors<ul>
<li>From let to right<ul>
<li>Masking color: Select a masking color (The results will appear for this index)</li>
<li>Operation: Select proper operation (summation or subtraction)</li>
<li>Masking color: Select a masking color</li>
<li>Image selection: select MRI or Ultrasound</li>
<li>Apply: Execut masking
 
<p align="center"> 
<img src="resource/manual_images/tools_maskO.png" alt="MELAGE" width="600" style="border:1px solid black" object-fit="contain"/>
</p>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
<li>
<p>Change CS</p>
<ul>
<li>To change image coordinate system</li>
<li>From left to right<ul>
<li>Image selection</li>
<li>From : show the current coordinate system</li>
<li>To: choose the desired coordinate system from the combo box</li>
<li>Apply: run the algorithm to see the results
 
<p align="center"> 
<img src="resource/manual_images/tools_cs.png" alt="MELAGE" width="600" style="border:1px solid black" object-fit="contain"/>
</p>
</li>
</ul>
</li>
</ul>
</li>
<li>
<p>Basic info
 
<p align="center"> 
<img src="resource/manual_images/tools_basic.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
</p>
</p>
<ul>
<li>It includes <ul>
<li>image histogram: To show image histogram</li>
<li>Resize: Isotropic resizing imgage to a desire spacing <p align="center"> 
<img src="resource/manual_images/tools_resize.png" alt="MELAGE" width="400" style="border:1px solid black" object-fit="contain"/>
</p> </li>
<li>Images info. : information extracted from a loaded image. In the bottom there is a search option. <p align="center"> 
<img src="resource/manual_images/tools_imageinfo.png" alt="MELAGE" width="500" style="border:1px solid black" object-fit="contain"/>
</p> </li>
</ul>
</li>
</ul>
</li>
</ul>
<h2>File Menu</h2>
<p align="center"> 
<img src="resource/manual_images/menu_file.png" alt="MELAGE" width="500" style="border:1px solid black" object-fit="contain"/>
</p>

<ul>
<li>It includes:<ul>
<li>New project: To create a new project</li>
<li>Load project: To load a previously save project</li>
<li>Save: To save the current project</li>
<li>Save as: To save the current project into another file</li>
<li>Import: Import a segmentation file <p align="center"> 
<img src="resource/manual_images/menu_file_import.png" alt="MELAGE" width="500" style="border:1px solid black" object-fit="contain"/>
</p> </li>
<li>Export: Export modified image or modified segmentation as a new file. It automatically adds a suffix to the end of the current file. <p align="center"> 
<img src="resource/manual_images/menu_file_export.png" alt="MELAGE" width="500" style="border:1px solid black" object-fit="contain"/>
</p> </li>
<li>Screen shot: Take a screen shot form one of the plane or whole of the scene. <p align="center"> 
<img src="resource/manual_images/menu_file_ss.png" alt="MELAGE" width="500" style="border:1px solid black" object-fit="contain"/>
</p> </li>
<li>Close US project: Closing an ultrasound image or the image appears on the top.</li>
<li>Close MRI project: Closing a MRI image or the image appears on the bottom</li>
<li>Setting: To change defaults setting of the application. align="center"&gt; 
<img src="resource/manual_images/menu_file_settings.png" alt="MELAGE" width="500" style="border:1px solid black" object-fit="contain"/>
</p> </li>
<li>Exit: To exit the application. On pressing this button another window appears to ask you if you want to save the project or not.</li>
</ul>
</li>
</ul>
<h1>license</h1>
<p>To ask for a license please contact <a href = "mailto: melage@inbica.com">mealge@inibica.es</a> or <a href = "mailto: jafrasteh.bahram@inibica.es">jafrasteh.bahram@inibica.es</a>.</p>
<h1>Citation and acknowledgements</h1>
<p>Please cite us:</p>
<pre><code>Jafrasteh, B., Lubián-López, S. P., &amp; Benavente-Fernández, I. (2023). 
MELAGE: A purely python based Neuroimaging software (Neonatal). arXiv preprint arXiv:X.X.

</code></pre>
<h1>Releases</h1>
<ul>
<li>v1.0.0:<ul>
<li>Add search line to find colors</li>
<li>Change tables and enable export, edit, add, remove for measurement table</li>
<li>Enable perimeter measurements</li>
<li>During export a ".json" files will be exported alongside the output file.</li>
<li>Correction the problem of left and right direction of brain in the images.</li>
</ul>
</li>
<li>v0.9.0:</li>
<li>correction of problems with sagittal to coronal and coronal to sagital correction for ultrasound images.</li>
<li>
<p>reading the color format of ITK and FSL has been improved.</p>
</li>
<li>
<p>v0.8.0:</p>
</li>
<li>Color appearance improved.</li>
<li>rotation speed improved.</li>
<li>segmentation after rotation improved</li>
<li>improved saving table to csv format</li>
<li>
<p>nrrd reading</p>
</li>
<li>
<p>v0.0.7:</p>
</li>
<li>Reading system for MRI and US images improved</li>
<li>nrrd support</li>
<li>version info is saved into the file</li>
<li>DICOM folder and file reading enabled</li>
</ul>

</body>
</html>