# CSJ2K.j2k.roi.encoder.ROI.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="CSJ2K_j2k_roi_encoder_ROI__ctor_" data-uid="CSJ2K.j2k.roi.encoder.ROI.#ctor*">ROI Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="CSJ2K_j2k_roi_encoder_ROI__ctor_" data-uid="CSJ2K.j2k.roi.encoder.ROI.#ctor*"></a>
<h4 id="CSJ2K_j2k_roi_encoder_ROI__ctor_System_Int32_CSJ2K_j2k_image_input_ImgReaderPGM_" data-uid="CSJ2K.j2k.roi.encoder.ROI.#ctor(System.Int32,CSJ2K.j2k.image.input.ImgReaderPGM)">ROI(int, ImgReaderPGM)</h4>
<div class="markdown level1 summary"><p>Constructor for ROI with arbitrary shape</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ROI(int comp, ImgReaderPGM maskPGM)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(comp As Integer, maskPGM As ImgReaderPGM)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">comp</span></td>
      <td><p>The component the ROI belongs to</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="CSJ2K.j2k.image.input.ImgReaderPGM.html">ImgReaderPGM</a></td>
      <td><span class="parametername">maskPGM</span></td>
      <td><p>ImgReaderPGM containing the ROI</p>
</td>
    </tr>
  </tbody>
</table>


<a id="CSJ2K_j2k_roi_encoder_ROI__ctor_" data-uid="CSJ2K.j2k.roi.encoder.ROI.#ctor*"></a>
<h4 id="CSJ2K_j2k_roi_encoder_ROI__ctor_System_Int32_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.roi.encoder.ROI.#ctor(System.Int32,System.Int32,System.Int32,System.Int32,System.Int32)">ROI(int, int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Constructor for rectangular ROIs</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ROI(int comp, int ulx, int uly, int w, int h)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(comp As Integer, ulx As Integer, uly As Integer, w As Integer, h As Integer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">comp</span></td>
      <td><p>The component the ROI belongs to</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">ulx</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">uly</span></td>
      <td></td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">w</span></td>
      <td><p>width of ROI</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">h</span></td>
      <td><p>height of ROI</p>
</td>
    </tr>
  </tbody>
</table>


<a id="CSJ2K_j2k_roi_encoder_ROI__ctor_" data-uid="CSJ2K.j2k.roi.encoder.ROI.#ctor*"></a>
<h4 id="CSJ2K_j2k_roi_encoder_ROI__ctor_System_Int32_System_Int32_System_Int32_System_Int32_" data-uid="CSJ2K.j2k.roi.encoder.ROI.#ctor(System.Int32,System.Int32,System.Int32,System.Int32)">ROI(int, int, int, int)</h4>
<div class="markdown level1 summary"><p>Constructor for circular ROIs</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ROI(int comp, int x, int y, int rad)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(comp As Integer, x As Integer, y As Integer, rad As Integer)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">comp</span></td>
      <td><p>The component the ROI belongs to</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">x</span></td>
      <td><p>x-coordinate of center of ROI</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">y</span></td>
      <td><p>y-coordinate of center of ROI</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></td>
      <td><span class="parametername">rad</span></td>
      <td></td>
    </tr>
  </tbody>
</table>
</div>
