MIL_CONST_TEXT_PTR FileName, | //in |
MIL_INT64 FileFormat, | //in |
MIL_ID DatasetContextClassId, | //in |
MIL_INT64 Index, | //in |
MIL_INT64 ImportType, | //in |
MIL_INT64 ControlFlag | //in |
This function imports data from a CSV file to a dataset context. Imported data is appended to any existing data in the dataset. To export data from a dataset, use MclassExport().
When importing from a CSV file, it must adhere to formatting requirements and contain the required data (this can depend on what you are importing). For more information, see the Importing data from a CSV file to a dataset context subsection of the Datasets section of Chapter 20: Classification.
Specifies the name and path of the file from which to import. The function handles (internally) the opening and closing of the file. For easier use with other Matrox Imaging software products, the specified file name must use the CSV file extension. A CSV file represents a common format that holds comma separated values.
Set this parameter to one of the values below.
For specifying the file name and path
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_INTERACTIVE |
[This is
only applicable to Windows]
Opens a dialog box from which to interactively specify the file's drive, directory, and name. |
||||||||||||||||||||||||||||||||||||||
MIL_TEXT("FileName") 1 |
Specifies the file's drive, directory, and name (for example, "E:\Manual\MySweetSweetDataset.csv"). To specify a dataset file on a remote computer (under Distributed MIL), prefix the file name string with "remote:///" (for example, "remote:///E:\Manual\\MyEvenSweeterDataset.csv"). (summarize)Specifies the file's drive, directory, and name (for example, "E:\Manual\MySweetSweetDataset.csv"). (more details...) |
1 If you are passing the value in a variable, don't enclose it in MIL_TEXT().
Specifies the format of the file from which to import. Set this parameter to the value below.
For specifying the file format
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_FORMAT_CSV |
Specifies a CSV file format. Note that if a field value in the CSV file contains commas, the value should be delimited within double quotation marks. (summarize)Specifies a CSV file format. (more details...) |
Specifies the identifier of the dataset context in which to import. Set this parameter to one of the following values.
For specifying the dataset context in which to
import
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
ContextDatasetId |
Specifies the identifier of a features or images dataset context. This context is allocated using MclassAlloc() with M_DATASET_FEATURES or M_DATASET_IMAGES. (summarize)Specifies the identifier of a features or images dataset context. (more details...) |
Specifies the type of import operation to perform.
To restore an exported dataset, you must call this function for each type of import operation.
The order in which you import data is important. You should import authors and class definitions first, and then import entries, as entries require authors and class definitions.
If you only import entries, MIL automatically creates class definitions and authors according to the information in the entries. If you import class definitions or authors afterward, MIL appends them to the already existing ones. If MIL encounters non-existing class definitions or authors when importing entries, they are automatically added to the dataset using default values.
Set this parameter to one of the following values.
For specifying the type of the file that you can
import
|
|||||||||||||||||||||||||||||||||||||||
Value | Description | ||||||||||||||||||||||||||||||||||||||
M_AUTHORS |
Specifies to import authors from a CSV file. In this case, use the headers below (and provide the corresponding lines of information after the header) in the CSV file. Key,AuthorName
Both of these fields are required. (summarize)Specifies to import authors from a CSV file. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_CLASS_DEFINITIONS |
Specifies to import class definitions from a CSV file. In this case, use the headers below (and provide the corresponding lines of information after the header) in the CSV file.
Key,Name,Color_R,Color_G,Color_B,Weight
The 'Key' and 'Name' fields are required; the others are optional. (summarize)Specifies to import class definitions from a CSV file. (more details...) |
||||||||||||||||||||||||||||||||||||||
M_ENTRIES |
Specifies to import the entries from a CSV file. In this case, use the headers below (and provide the corresponding lines of information after the headers) in the CSV file. For an images dataset:
Key,FilePath,AuthorName,AugmentationSource,RegionType,ClassIdxGroundTruth_...,ClassIdxPredicted_...,ClassScorePredicted_...,UserString
For a features dataset:
Key,FilePath,AuthorName,AugmentationSource,Data_...,ClassIdxGroundTruth_...,ClassIdxPredicted_...,ClassScorePredicted_...,UserString,EntryWeight
For either dataset, the 'Key', 'FilePath', and 'ClassIdxGroundTruth_...' fields are required; the others are optional. The fields with an underscore and an ellipsis, such as 'Data_...', represent an array of values. You must replace the ellipsis with an integer, starting at 0 for the first array value, and increasing by 1 for each subsequent array value; for example:
Key,FilePath,AuthorName,AugmentationSource,Data_0,Data_1,Data_2,ClassIdxGroundTruth
0,E:\Images\Class1\0001.mim,Matrox,NOT_AUGMENTED,99,66,77,1
Specifies to import the entries from a CSV file. (more details...) |
Header | Include mil.h. |
Library | Use mil.lib; milclass.lib. |
DLL | Requires mil.dll; milclass.dll. |