Skip to content

Main content

Menu Portion Reference Image Index Tool

Select an explicit one-based menu-portion reference image identifier without estimating portion size from an image.

Loading tool…

Description

Select a supplied portion-reference image ID by a one-based index.

Dietary arithmetic depends on as-purchased versus edible mass, per-serving versus per-100-gram bases, measured versus trace states and recall periods. A recorded allergen list is not a verified allergen-free declaration. Portion counts, label intervals and mass differences use supplied assumptions rather than establishing actual intake or nutritional suitability.

Select a supplied portion-reference image ID by a one-based index.

When to use this tool

Use Menu Portion Reference Image Index when you already have imageIds, indexOneBased and need to select a supplied portion-reference image ID by a one-based index.

How to use the tool and how it works

  1. Enter imageIds, indexOneBased. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read selectedImageId. Use the output convention below.

Require indexOneBased a safe integer in [1,imageIds.length]; return the corresponding ID.1

Input fieldMeaning and unitsAccepted input
imageIdsImage IdsRequired. Array of text; maximum UTF-16 length 8192; maximum items 256.
indexOneBasedIndex One BasedRequired. Safe integer; minimum 1.
Output fieldInterpretationReturned shape
selectedImageIdSelected Image IdRequired. Text; maximum UTF-16 length 8192.
json
{
  "input": {
    "imageIds": [
      "IMG4",
      "IMG5",
      "IMG6"
    ],
    "indexOneBased": 2
  },
  "output": {
    "selectedImageId": "IMG5"
  }
}

Limitations and assumptions

  • IDs can be empty or repeated; an empty list has no valid selection. No image is loaded, portion estimated or suitable serving identified.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Check original food labels, composition sources, ingredient/allergen information and dietary records before combining amounts. Use a complete appropriately interpreted dietary assessment when requirements or suitable intake matter; local scaling and source labels do not make those judgments.

References

  1. Calculation and input contract: dietetics/menu-portion-reference-image-index — tool.io

Similar or alternative tools