{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "victorbutoi-flexray--segment-xray-images-from-the-command-line",
 "repo": "VictorButoi/FleXray",
 "repo_url": "https://github.com/VictorButoi/FleXray",
 "repo_slug": "victorbutoi-flexray",
 "title": "Segment X-ray images into anatomy masks from the terminal",
 "page_title": "How to segment X-ray images into anatomy masks from the terminal with Fle Xray",
 "summary": "Run flexify on one image or a folder and get NumPy mask, probability, and logit arrays.",
 "who": "A medical imaging researcher or data engineer who has a set of X-ray images and needs anatomy masks without writing model code.",
 "problem": "Manually outlining anatomy on many X-rays is slow, and many segmentation tools need model setup before any output appears.",
 "outcome": "A predictions folder containing image_masks.npy, image_probabilities.npy, image_logits.npy, and label_names.json for each input.",
 "steps": [
  "Install the package with `python -m pip install flexray`.",
  "Run a single prediction with `flexify --input ./image.png --output-dir ./predictions`.",
  "To predict a whole folder, pass the folder to the same command with `flexify --input ./xrays --output-dir ./predictions`. (inferred, check the README)",
  "Open label_names.json to map channel numbers to anatomical labels, then load the .npy files with NumPy."
 ],
 "agent_prompt": "In the FleXray repo (pip package flexray), run `flexify --input <input-path> --output-dir <output-dir>` on the target X-ray image or folder. Expect image_masks.npy, image_probabilities.npy, image_logits.npy, and label_names.json per image. Verify that the masks arrays are CxHxW with C equal to the number of labels in label_names.json.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "15 minutes",
 "basis": "readme",
 "caveat": "The README describes segmentation output but does not state clinical validation, so treat masks as research output unless you verify them yourself.",
 "category": "Research",
 "tags": [
  "Research"
 ],
 "lang": "python",
 "requirements": [
  "Python 3.10 or newer and pip",
  "One or more X-ray images in PNG, JPEG, TIFF, BMP, or DICOM (DICOM needs the dicom extra)",
  "Internet access to download pretrained weights from Hugging Face on first run",
  "For training only: a labeled dataset, and a GPU or CPU for the dry run; the README says training is single-process with at most one GPU",
  "For the MCP use case: an MCP-capable client such as Claude Code or Claude Desktop"
 ],
 "risk": "sensitive",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "The first run downloads weights from Hugging Face, so a token may be needed if access to the repository is restricted in your environment."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/victorbutoi-flexray/segment-xray-images-from-the-command-line/",
 "md": "https://dedupedai.com/use-cases/victorbutoi-flexray/segment-xray-images-from-the-command-line/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/victorbutoi-flexray--segment-xray-images-from-the-command-line.json",
 "api_version": "v1"
}
