Logo vun Diffusion Mri

Diffusion Mri

Communautéit
KeWang0622
diffusion-mri

Read before fitting, converting or reporting diffusion-weighted MRI: ADC, DTI/DKI, IVIM, NODDI, compartment or spectrum fractions, tractography and diffusion biomarker studies. Prevents silent errors in b-vector frames and vendor vector files, the b-range for ADC/DTI, units, noise floor and uncalibrated or unstable fraction models. Ships tested numpy helpers (frame conversion, tensor fit, noise floor, calibration, stratified recovery and retest tests). Starts from reconstructed DWI.

Iwwersiicht

EditeurKeWang0622
RepositoryMRFoundry
Skill-Nummdiffusion-mri
Stären
31
Forks
0
Matgeliwwert Fichieren
7
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 7 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum KeWang0622 op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Diffusion Mri an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/KeWang0622/MRFoundry/tree/main/skills/diffusion-mri
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an de Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/KeWang0622/MRFoundry.git /tmp/MRFoundry
mkdir -p .claude/skills
cp -r /tmp/MRFoundry/skills/diffusion-mri .claude/skills/diffusion-mri
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Diffusion Mri an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Diffusion Mri automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Diffusion Mri net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

MRFoundry: Diffusion MRI

Use the tested numpy helpers; a closed-form log-linear DTI fit needs no toolbox installation. Open only the row you need; python .agents/skills/diffusion-mri/scripts/spectrum_fit.py --api (or gradient_frames.py) lists signatures (do not cat the source).

Route

TaskUse (scripts/)Read only if needed
Gradient tables, frames, DTI/DKI orientation, b-valuesgradient_frames.py: array_from_fsl, fsl_from_world, world_from_array, world_from_lps, bvals_bvecs_from_vectors, fit_tensor_lls, simulate_tensor_signalDWI and DTI
ADC, signal fractions, diffusivity spectra, IVIM-type fitsspectrum_fit.py: background_sigma, floor_correct, adc_fit, fit_weights, fit_fixed_basis, calibrate_basis, fraction_below, stratified_recovery_testmodel calibration
Preprocessing (denoise, Gibbs, topup/eddy), CSD, NODDI, tractography, QSIPrepMRtrix3, FSL, DIPY, AMICOpreprocessing and models
Group comparisons, repeatability, cutoffsmri-research-workflow/scripts/study_stats.pymri-research-workflow

Checks that prevent silent errors

  1. Frames as a rule, then an independent test. FSL bvecs are array-axis components with x negated when det(affine[:3, :3]) > 0; MRtrix3 -grad tables are world coordinates; vendor vector files state their own frame (for example patient LPS) and b-value encoding (b may scale with the squared vector norm). Fit in one declared frame and report orientations in world coordinates. Verify with simulate_tensor_signal: build signals from a known world fibre direction, pass them through YOUR conversion and fit, and confirm the reported direction. A check that reuses your conversion in both directions cannot detect a frame error.
  2. Shells for ADC/DTI come from the study or task, not from a habit. If the task states a single-tensor (Gaussian) signal model, fit every diffusion-weighted volume. For in vivo data with shells above about 1500 s/mm², a conventional ADC/DTI may keep the lower shells (adc_fit(..., bmax=1000)); DKI fits all shells. Never hard-code a b cutoff in an entrypoint that is rerun on other schemes: it can leave fewer than six directions or no volumes at all.
  3. Units: MD and ADC in mm²/s (brain tissue about 0.6e-3 to 1.0e-3, free water about 3e-3 at body temperature) or µm²/ms (x1000); b in s/mm². Check map medians with finish_check.py --range in the units the task asks for.
  4. Fractions and spectra are ill-conditioned: default to a regularized spectrum with the weight chosen on development data; calibrate any fixed basis on pooled development curves (calibrate_basis) and check identifiability; never copy diffusivities from examples, other organs or protocols.
  5. Stratified recovery tests (stratified_recovery_test): truth for each compared group from development fits, a generative model that differs from the fitting basis, the real b-values and noise. Choose settings by the worst group or bin RMSE, then confirm the worst bias and voxelwise stability (retest_tol= reports the fraction of voxels whose estimate changes between two noise realizations). A pooled bias near zero proves nothing about any one tissue.
  6. Noise floor at high b: estimate sigma from background (background_sigma) and correct (floor_correct) or fit a Rician-aware model.
  7. Studies: summarize per subject and session, declare the statistical unit for each endpoint, make every choice on development subjects only, and recompute every reported number from the saved maps.

Before you finish

python .agents/skills/mri-research-workflow/scripts/finish_check.py --require <every deliverable name> \
    --rerun "python <entrypoint> <documented arguments with {inputs} and {out}>" --inputs <input folder> \
    --range <md map>:<low>:<high>      # e.g. 0.0001:0.004 for MD in mm²/s

Setup and scope

  • Use the workspace interpreter (.venv/bin/python if present); numpy and scipy cover the helpers. Install DIPY, MRtrix3 or FSL only for steps that need them; see the tool setup guide if an install fails.
  • Citations: reading list. Project notes (only with .mrfoundry/INDEX.md): project memory.
  • Raw k-space: mri-reconstruction. Acquisition design: pulse-sequence-design. Non-diffusion image analysis: mri-research.

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Diffusion Mri?

Read before fitting, converting or reporting diffusion-weighted MRI: ADC, DTI/DKI, IVIM, NODDI, compartment or spectrum fractions, tractography and diffusion biomarker studies. Prevents silent errors in b-vector frames and vendor vector files, the b-range for ADC/DTI, units, noise floor and uncalibrated or unstable fraction models. Ships tested numpy helpers (frame conversion, tensor fit, noise floor, calibration, stratified recovery and retest tests). Starts from reconstructed DWI.

Firwat Diffusion Mri op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Diffusion Mri besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Diffusion Mri an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/KeWang0622/MRFoundry/tree/main/skills/diffusion-mri an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Diffusion Mri benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Diffusion Mri benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Diffusion Mri domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Diffusion Mri gratis?

Jo. De Skill gëtt vum KeWang0622 ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇