Logo: Mri Reconstruction

Mri Reconstruction

Communautéit
KeWang0622
mri-reconstruction

Read before turning MR data into images or parameter maps: raw k-space (Cartesian, radial, spiral, EPI; twix, ISMRMRD, numpy), GRAPPA/SENSE, coil combination, off-resonance correction, BART or SigPy, and T1, T2/EPG, T2*, water-fat (PDFF), ASL, DCE or QSM maps. Prevents silent errors in encoding sign, acceleration pattern, orientation, noise covariance and floor, water- fat swaps, timing origin and units. Ships tested numpy helpers and a finish check. Trained networks: deep-learning-recon; diffusion: diffusion-mri.

Iwwersiicht

EditeurKeWang0622
RepositoryMRFoundry
Skill-Nummmri-reconstruction
Stären
31
Forks
0
Matgeliwwert Dateien
15
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.

  • 15 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

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

Installatioun

Installéiert de KI-Skill Mri Reconstruction an TypingMind, fir e mat all LLM ze benotzen, oder setzt 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 „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/KeWang0622/MRFoundry/tree/main/skills/mri-reconstruction
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng 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 d'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/mri-reconstruction .claude/skills/mri-reconstruction
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Mri Reconstruction 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 Mri Reconstruction automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Mri Reconstruction 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-Schlësselen.

  • 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: MRI Reconstruction and Quantitative Maps

Do the work with the tested helpers below instead of re-deriving their maths; open only the row you need. Hand-written versions of these steps failed silently in evaluation runs.

Route

TaskUse (scripts/)Read only if needed
Undersampled multi-coil Cartesian: R, offset and ACS from the mask, GRAPPA, CG-SENSE, prewhitening, coil combination, SNR unitsmrfoundry_rawrecon.py: sampling_pattern, grappa_from_mask, sense_combine, prewhitenraw-data checklist
Non-Cartesian (radial, spiral): exact forward model, NUFFT least squares; off-resonance with a field mapmrfoundry_reconlib.py: offres_least_squares, smooth_fieldraw-data checklist
Water-fat separation, PDFF, R2* (multi-echo GRE, multi-peak fat)fatwater_lib.py: fat_offsets_hz, fit_fat_water, fat_fractionquantitative maps
BART or SigPy pipelines; twix, ISMRMRD, .cfl filesbart_recon.shBART and SigPy
T1, T2, T2*, VFA, dictionaries, multi-echo spin echo with B1 (EPG)qmri_fit.pyquantitative maps
ASL CBF and arrival time, single or multiple delaysqmri_fit.py: asl_pairs_by_delay, slice_delays, asl_effective_efficiency (background suppression), m0_finite_tr, asl_cbf_pcasl, fit_asl_multidelayASL
DCE: signal to concentration, extended Toftsqmri_fit.py: spgr_concentration, fit_toftsDCE
QSM: phase to field, background removal, dipole inversion, reference regionqsm_lib.py: run_pipeline (phase_misfit_fraction < 0.01; --selftest with your acquisition must PASS)QSM
Fixed settings of a fitted model (nuisance values, spectra, fractions)model calibration
One-file standalone entrypointpython .agents/skills/mri-research-workflow/scripts/inline_helpers.py <module.py> <functions> --into <entrypoint.py> copies the tested helpers

Import with sys.path.insert(0, '.agents/skills/mri-reconstruction/scripts'). python <module>.py --api prints the signatures (do not read the sources); scripts/test_<module>.py has worked examples. Never retype a helper into a standalone entrypoint: copy it with inline_helpers.py (a retyped GRAPPA took the wrong acceleration factor from the mask and still gave plausible maps).

Checks that prevent silent errors

  1. Write the conventions down first: axis order and which sample is k = 0, encoding sign (exp(-i2πk·r): ifft2c; exp(+i2πk·r): image_from_kspace(ksp, encoding_sign=+1)), readout oversampling, output grid [y, x], units and time origin of every input. Read protocol values from the file or sidecar.
  2. Validate with an independent forward model: simulate a known asymmetric object or parameter set through your exact sampling and timing (direct_dft_signed, direct_dft, quadrature, analytic signals), then run your pipeline: orientation_check(img, truth) must return ('identity', (0, 0)) and parameters must come back. A round trip through your own transforms cannot reveal a sign, axis or timing error.
  3. Noise: Psi = E[n n^H] from noise samples [coil, samples] (noise_covariance); scale it by noise dwell / imaging dwell (scale_noise_covariance); averaging N acquisitions divides it by N. SNR units: snr_units_image; confirm the real-part noise SD is 1 on a pure-noise or pseudo-replica run, never from low-magnitude pixels of the image.
  4. Choose the reconstruction by simulated error (rank_reconstructions with your sampling and measured noise; metric= the endpoint error when the deliverable is a parameter map): exact data consistency is not image quality; at R >= 3 it keeps or amplifies noise.
  5. Fits: use the stated model and time origin. Multi-echo magnitude at low SNR: combine coils with the SAME phase-preserving weights for every echo (sense_combine), then pass noise_sigma (and n_channels for RSS) to fit_monoexp or fit_dictionary; an RSS log-linear fit overestimates T2 by several percent. Water-fat: fit_fat_water chooses among field-map candidates with a smooth field (voxelwise minima swap water and fat in isolated high-fat regions), then fat_fraction(water_real, fat_real, flip, TR, T1w, T1f, b1). Check map units against expected ranges (finish_check.py --range).
  6. Standalone entrypoints read every protocol value (matrix, coils, acceleration, delays, echo times, field strength, slice timing, frame times, scale factors) from the inputs; run them on a second simulated input with OTHER values (another acceleration, field strength or echo train) before finishing.

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>

Put the entrypoint and all outputs in the folder the task names (the workspace root if none). Fix every FAIL line and rerun the check. Report numbers read back from the saved outputs.

Setup and scope

  • Use the workspace interpreter (.venv/bin/python if present) and -m pip install only missing packages; numpy and scipy cover every helper here. Read the tool setup guide only if an install fails or you need BART, Julia or a GPU toolbox.
  • Ongoing projects with .mrfoundry/INDEX.md: project memory. Citations: reading list; method evidence and claims: evaluation guide.
  • Trained networks: deep-learning-recon. Acquisition design: pulse-sequence-design. Diffusion models: diffusion-mri. Spectroscopy: mri-research (scripts/mrs_lib.py).

Matgeliwwert Dateien

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 Mri Reconstruction?

Read before turning MR data into images or parameter maps: raw k-space (Cartesian, radial, spiral, EPI; twix, ISMRMRD, numpy), GRAPPA/SENSE, coil combination, off-resonance correction, BART or SigPy, and T1, T2/EPG, T2*, water-fat (PDFF), ASL, DCE or QSM maps. Prevents silent errors in encoding sign, acceleration pattern, orientation, noise covariance and floor, water- fat swaps, timing origin and units. Ships tested numpy helpers and a finish check. Trained networks: deep-learning-recon; diffusion: diffusion-mri.

Firwat Mri Reconstruction op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Mri Reconstruction 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 en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

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

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/KeWang0622/MRFoundry/tree/main/skills/mri-reconstruction 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 Mri Reconstruction 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 Mri Reconstruction benotzen?

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

Ass de KI-Skill Mri Reconstruction gratis?

Jo. KeWang0622 huet de Skill ë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 weiderverwendbare Pak vun Instruktiounen, deen 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 e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

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