Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Copy/paste into the Avizo/Amira Python console.
- # Alternatively, save to a file, add that file to your path, and import.
- # See docstring for usage.
- def get_cell_contents(tablelike_object,row,column,table=0):
- """
- Retrieves contents of cell i,j in a table through
- HxSpreadSheetInterface.
- You must use the object handle, not just the name of the object! For example,
- to get the contents of row 4 from column 5 of a HxLabelAnalysis data object
- named "chocolate-bar.Label-Analysis" with only one tab:
- >>> spreadsheet_data = hx_project.get('chocolate-bar.Label-Analysis')
- >>> cell_value = get_cell_contents(spreadsheet_data,4,5)
- Parameters
- ----------
- tablelike_object : HxLabelAnalysis, HxSpreadSheet, HxImageAnalysis
- The handle to the table-like object.
- row : Int
- Row number from which to retrieve value (starting at 0).
- column : Int
- Column number from which to retrieve value (starting at 0).
- table : Int
- Table (i.e. tab) from which to retrieve value (starting at 0).
- Defaults to the first (or only) tab. Useful for results of
- spatial graphs, where there are 3+ tabs.
- Returns
- -------
- out : See note
- Contents of the specified cell.
- Note: returned valued has same type of column the item is
- received from.
- """
- ssi = tablelike_object.all_interfaces.HxSpreadSheetInterface
- return ssi.tables[table].items[row,column]
Add Comment
Please, Sign In to add comment