Image
The `sofa::helper::io::Image` class in SOFA is designed for handling image data, including loading and saving images with various formats and types (e.g., compressed or uncompressed). This component provides methods to access the dimensions (width, height, depth) of an image at different mipmaps levels and retrieve pixel data. It also offers functionality for initializing an image based on specified parameters such as width, height, depth, number of mipmaps, data type, and channel format. **Role in SOFA Ecosystem:** The `Image` class plays a critical role in managing image-related operations within the SOFA framework. It is typically used in scenarios where images need to be processed or visualized as part of medical simulations, such as loading medical imaging data (e.g., MRI scans) for further analysis. **Interactions with Other Components:** The `Image` class interacts primarily through its API, which includes methods like `load`, `save`, and various getters (`getWidth`, `getHeight`, etc.) that allow other SOFA components to access or modify image data. It is also integrated into the Factory system for creating specific types of images based on file extensions. **Practical Usage Guidance:** The `Image` class can be used to load an image from a file, initialize an empty image with specified dimensions and properties, and retrieve pixel data at different mipmap levels. The `create` method is useful for constructing instances of derived classes that extend the basic functionality of `Image`. Additionally, methods like `getTextureType`, `getBytesPerPixel`, and `getImageSize` provide detailed information about the image's structure and storage requirements. **Data Fields:** The class has data fields such as `width`, `height`, `depth`, `mipmaps`, `dataType`, `channelFormat`, and a pointer to raw pixel data (`data`). It also maintains state flags like `m_bLoaded` for tracking the image's loading status.
- abstract
- The `Image` class in SOFA manages image data, providing methods for loading, saving, and accessing dimensions and pixel information at different mipmap levels.
- sheet
- # Image ## Overview The `sofa::helper::io::Image` class is an I/O component designed to handle image data within the SOFA framework. It supports operations such as loading and saving images in various formats, retrieving dimensions (width, height, depth) at different mipmap levels, and accessing pixel data. ## Parameters and Data The `Image` class exposes several methods for initializing and querying image properties: - **init**: Initializes an empty image with specified width, height, depth, number of mipmaps, data type, and channel format. Alternatively, it can be initialized with just the width, height, and bytes per pixel. - **getWidth**, **getHeight**, **getDepth**: Retrieve dimensions at a given mipmap level. - **getBytesPerPixel**, **getBytesPerBlock**, **getBytesPerChannel**: Return the number of bytes per pixel, block, or channel. - **getChannelCount**, **getMipmapCount**: Provide the count of channels and mipmaps. - **getPixelCount**, **getLineSize**, **getMipmapSize**, **getMipmapRangeSize**, **getImageSize**: Retrieve various size-related properties. - **getDataType**, **getChannelFormat**, **getTextureType**: Return the data type, channel format, and texture type of the image. - **getPixels**, **getMipmapPixels**, **getCubeMipmapPixels**, **get3DSliceMipmapPixels**: Retrieve pixel data for different mipmap levels or slices. - **clear**: Clears the image data. - **isLoaded**: Checks if the image is loaded. - **load**, **save**: Load and save images from/to a file with optional compression level.
- description
- The `sofa::helper::io::Image` class in SOFA is designed for handling image data, including loading and saving images with various formats and types (e.g., compressed or uncompressed). This component provides methods to access the dimensions (width, height, depth) of an image at different mipmaps levels and retrieve pixel data. It also offers functionality for initializing an image based on specified parameters such as width, height, depth, number of mipmaps, data type, and channel format. **Role in SOFA Ecosystem:** The `Image` class plays a critical role in managing image-related operations within the SOFA framework. It is typically used in scenarios where images need to be processed or visualized as part of medical simulations, such as loading medical imaging data (e.g., MRI scans) for further analysis. **Interactions with Other Components:** The `Image` class interacts primarily through its API, which includes methods like `load`, `save`, and various getters (`getWidth`, `getHeight`, etc.) that allow other SOFA components to access or modify image data. It is also integrated into the Factory system for creating specific types of images based on file extensions. **Practical Usage Guidance:** The `Image` class can be used to load an image from a file, initialize an empty image with specified dimensions and properties, and retrieve pixel data at different mipmap levels. The `create` method is useful for constructing instances of derived classes that extend the basic functionality of `Image`. Additionally, methods like `getTextureType`, `getBytesPerPixel`, and `getImageSize` provide detailed information about the image's structure and storage requirements. **Data Fields:** The class has data fields such as `width`, `height`, `depth`, `mipmaps`, `dataType`, `channelFormat`, and a pointer to raw pixel data (`data`). It also maintains state flags like `m_bLoaded` for tracking the image's loading status.
- maths
- The `sofa::helper::io::Image` class in the SOFA framework is designed to manage image data, including operations for loading and saving images with various formats. This component provides methods for accessing dimensions (width, height, depth) of an image at different mipmap levels and retrieving pixel data. It does not directly contribute to the governing equations or operators typically associated with FEM simulations, such as mass matrix $M$, stiffness matrix $K$, internal force $oldsymbol{f}_{ ext{int}}$, residual $R$, etc. Instead, it focuses on handling image-related operations critical for medical simulations where images (e.g., MRI scans) need to be processed or visualized.
{
"name": "Image",
"main": {
"name": "Image",
"namespace": "sofa::helper::io",
"module": "Sofa.framework.Helper",
"include": "sofa/helper/io/Image.h",
"doc": "",
"inherits": [],
"templates": [],
"data_fields": [],
"links": [],
"methods": [
{
"name": "operator=",
"return_type": "Image &",
"params": [
{
"name": "rhs",
"type": "const Image &"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getWidth",
"return_type": "unsigned int",
"params": [
{
"name": "mipmap",
"type": "unsigned int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getHeight",
"return_type": "unsigned int",
"params": [
{
"name": "mipmap",
"type": "unsigned int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getDepth",
"return_type": "unsigned int",
"params": [
{
"name": "mipmap",
"type": "unsigned int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getBytesPerPixel",
"return_type": "unsigned int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getBytesPerBlock",
"return_type": "unsigned int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getBytesPerChannel",
"return_type": "unsigned int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getChannelCount",
"return_type": "unsigned int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getMipmapCount",
"return_type": "unsigned int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPixelCount",
"return_type": "unsigned int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getLineSize",
"return_type": "unsigned int",
"params": [
{
"name": "mipmap",
"type": "unsigned int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getMipmapSize",
"return_type": "unsigned int",
"params": [
{
"name": "mipmap",
"type": "unsigned int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getMipmapRangeSize",
"return_type": "unsigned int",
"params": [
{
"name": "firstMipmap",
"type": "unsigned int"
},
{
"name": "mipmaps",
"type": "unsigned int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getImageSize",
"return_type": "unsigned int",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getDataType",
"return_type": "DataType",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getChannelFormat",
"return_type": "ChannelFormat",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getTextureType",
"return_type": "TextureType",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getPixels",
"return_type": "unsigned char *",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getMipmapPixels",
"return_type": "unsigned char *",
"params": [
{
"name": "mipmap",
"type": "unsigned int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "getCubeMipmapPixels",
"return_type": "unsigned char *",
"params": [
{
"name": "cubeside",
"type": "unsigned int"
},
{
"name": "mipmap",
"type": "unsigned int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "get3DSliceMipmapPixels",
"return_type": "unsigned char *",
"params": [
{
"name": "slice",
"type": "unsigned int"
},
{
"name": "mipmap",
"type": "unsigned int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "clear",
"return_type": "void",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "init",
"return_type": "void",
"params": [
{
"name": "width",
"type": "unsigned int"
},
{
"name": "height",
"type": "unsigned int"
},
{
"name": "depth",
"type": "unsigned int"
},
{
"name": "mipmaps",
"type": "unsigned int"
},
{
"name": "dataType",
"type": "DataType"
},
{
"name": "channelFormat",
"type": "ChannelFormat"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "init",
"return_type": "void",
"params": [
{
"name": "width",
"type": "unsigned int"
},
{
"name": "height",
"type": "unsigned int"
},
{
"name": "bpp",
"type": "unsigned int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "Create",
"return_type": "Image *",
"params": [
{
"name": "filename",
"type": "int"
}
],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": true,
"access": "public"
},
{
"name": "isLoaded",
"return_type": "bool",
"params": [],
"is_virtual": false,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "load",
"return_type": "bool",
"params": [
{
"name": "filename",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
},
{
"name": "save",
"return_type": "bool",
"params": [
{
"name": "filename",
"type": "int"
},
{
"name": "compression_level",
"type": "int"
}
],
"is_virtual": true,
"is_pure_virtual": false,
"is_static": false,
"access": "public"
}
]
},
"desc": {
"description": "The `sofa::helper::io::Image` class in SOFA is designed for handling image data, including loading and saving images with various formats and types (e.g., compressed or uncompressed). This component provides methods to access the dimensions (width, height, depth) of an image at different mipmaps levels and retrieve pixel data. It also offers functionality for initializing an image based on specified parameters such as width, height, depth, number of mipmaps, data type, and channel format.\n\n**Role in SOFA Ecosystem:**\nThe `Image` class plays a critical role in managing image-related operations within the SOFA framework. It is typically used in scenarios where images need to be processed or visualized as part of medical simulations, such as loading medical imaging data (e.g., MRI scans) for further analysis.\n\n**Interactions with Other Components:**\nThe `Image` class interacts primarily through its API, which includes methods like `load`, `save`, and various getters (`getWidth`, `getHeight`, etc.) that allow other SOFA components to access or modify image data. It is also integrated into the Factory system for creating specific types of images based on file extensions.\n\n**Practical Usage Guidance:**\nThe `Image` class can be used to load an image from a file, initialize an empty image with specified dimensions and properties, and retrieve pixel data at different mipmap levels. The `create` method is useful for constructing instances of derived classes that extend the basic functionality of `Image`. Additionally, methods like `getTextureType`, `getBytesPerPixel`, and `getImageSize` provide detailed information about the image's structure and storage requirements.\n\n**Data Fields:**\nThe class has data fields such as `width`, `height`, `depth`, `mipmaps`, `dataType`, `channelFormat`, and a pointer to raw pixel data (`data`). It also maintains state flags like `m_bLoaded` for tracking the image's loading status."
},
"maths": {
"maths": "The `sofa::helper::io::Image` class in the SOFA framework is designed to manage image data, including operations for loading and saving images with various formats. This component provides methods for accessing dimensions (width, height, depth) of an image at different mipmap levels and retrieving pixel data. It does not directly contribute to the governing equations or operators typically associated with FEM simulations, such as mass matrix $M$, stiffness matrix $K$, internal force $\boldsymbol{f}_{\text{int}}$, residual $R$, etc. Instead, it focuses on handling image-related operations critical for medical simulations where images (e.g., MRI scans) need to be processed or visualized."
},
"summary": {
"abstract": "The `Image` class in SOFA manages image data, providing methods for loading, saving, and accessing dimensions and pixel information at different mipmap levels.",
"sheet": "# Image\n\n## Overview\nThe `sofa::helper::io::Image` class is an I/O component designed to handle image data within the SOFA framework. It supports operations such as loading and saving images in various formats, retrieving dimensions (width, height, depth) at different mipmap levels, and accessing pixel data.\n\n## Parameters and Data\nThe `Image` class exposes several methods for initializing and querying image properties:\n- **init**: Initializes an empty image with specified width, height, depth, number of mipmaps, data type, and channel format. Alternatively, it can be initialized with just the width, height, and bytes per pixel.\n- **getWidth**, **getHeight**, **getDepth**: Retrieve dimensions at a given mipmap level.\n- **getBytesPerPixel**, **getBytesPerBlock**, **getBytesPerChannel**: Return the number of bytes per pixel, block, or channel.\n- **getChannelCount**, **getMipmapCount**: Provide the count of channels and mipmaps.\n- **getPixelCount**, **getLineSize**, **getMipmapSize**, **getMipmapRangeSize**, **getImageSize**: Retrieve various size-related properties.\n- **getDataType**, **getChannelFormat**, **getTextureType**: Return the data type, channel format, and texture type of the image.\n- **getPixels**, **getMipmapPixels**, **getCubeMipmapPixels**, **get3DSliceMipmapPixels**: Retrieve pixel data for different mipmap levels or slices.\n- **clear**: Clears the image data.\n- **isLoaded**: Checks if the image is loaded.\n- **load**, **save**: Load and save images from/to a file with optional compression level."
}
}