Skip to content

Basic Usage

Load data

Initialize a case

Herein, assume the following directory structure:

1
2
3
4
.
└── CROP
    ├── 0_XXX_U
    └── 0_YYY_U

where CROP is the dataset name, and 0_XXX_U and 0_YYY_U are folders of two cases, normally containing those .tif and other files. The goal is to process the case 0_XXX_U using AICafe.

Firstly, you need to initialize the class aicafe.Case for the case you want to process.

1
2
3
import aicafe as ac

case = ac.Case(path='./0_XXX_U')

The new version (since 1.0) of AICafe has a "lazy loading" strategy, i.e. it usually does not require the user to manually load the image files in the case folder, but will automatically read them when a method needs it.

Check file structure

You can print some attributes of the instance of Case to check if the file structure is correct, for example,

1
2
3
4
5
6
7
8
# path of the case
print(case.path)
# name of the case
print(case.name_case)
# name of the dataset
print(case.name_dataset)
# types of all available tif files in the case folder
print(case.types_tifs_avail)
All attributes can be found in the class aicafe.Case .

Vessel tree

Back to top