wsidata.dataset.graph_data#

graph_data(wsi, feature_key, tile_key='tiles', graph_key=None, target_key=None)#

Create a PyTorch Geometric Data object from the graph data in WSIData.

Parameters:
wsiWSIData

The WSIData object containing the graph data.

feature_keystr

The key for the tile features.

tile_keystr, default: “tiles”

The key for the tiles.

graph_keystr, optional

The key for tile graph, defaults to “{tile_key}_graph”.

target_keystr, optional

The key for the target data in the observation table.

Returns:
torch_geometric.data.Data

A PyTorch Geometric Data object containing: - x: Node features (image features) - edge_index: Graph connectivity - edge_attr: Edge attributes (distances) - y: Target values (if target_key is provided)