Mri Reconstructionのロゴ

Mri Reconstruction

コミュニティ
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.

概要

公開者KeWang0622
リポジトリMRFoundry
スキル名mri-reconstruction
スター
31
フォーク
0
同梱ファイル
15
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 15個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    KeWang0622がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Mri Reconstruction」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/KeWang0622/MRFoundry/tree/main/skills/mri-reconstruction
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

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
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでMri Reconstructionを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にMri Reconstructionを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Mri Reconstructionは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

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).

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「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.

TypingMindでMri Reconstructionを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Mri Reconstructionはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにMri Reconstructionをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/KeWang0622/MRFoundry/tree/main/skills/mri-reconstructionを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Mri Reconstructionを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Mri Reconstructionで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもMri Reconstructionを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Mri Reconstruction」は無料ですか?

はい。KeWang0622がMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇