## ROIDataset


Dataset of image regions (ROIs) and integer class labels.


Usage

``` python
ROIDataset(
    rois,
    labels,
    transform=None,
)
```


## Parameters


`rois: npt.NDArray[np.uint8]`  
Images array of shape (N, C, Y, X).

`labels: npt.NDArray[np.int_]`  
Integer class labels of shape (N,).

`transform: Callable[[torch.Tensor], torch.Tensor] | None = None`  
Optional transform applied to each ROI tensor.


## Methods

| Name | Description |
|----|----|
| [__getitem__()](#__getitem__) | Return the ROI tensor and label tensor at the given index. |
| [__init__()](#__init__) | Initialise the dataset with ROI images and class labels. |
| [__len__()](#__len__) | Return the number of samples in the dataset. |

------------------------------------------------------------------------


#### \_\_getitem\_\_()


Return the ROI tensor and label tensor at the given index.


Usage

``` python
__getitem__(index)
```


------------------------------------------------------------------------


#### \_\_init\_\_()


Initialise the dataset with ROI images and class labels.


Usage

``` python
__init__(rois, labels, transform=None)
```


------------------------------------------------------------------------


#### \_\_len\_\_()


Return the number of samples in the dataset.


Usage

``` python
__len__()
```
