<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Internship on Bughht Blog</title><link>https://bughht.github.io/categories/internship/</link><description>Recent content in Internship on Bughht Blog</description><generator>Hugo</generator><language>zh-CN</language><managingEditor>hhong6@mgh.harvard.edu (Haotian Hong)</managingEditor><webMaster>hhong6@mgh.harvard.edu (Haotian Hong)</webMaster><lastBuildDate>Sat, 20 Dec 2025 15:09:46 +0800</lastBuildDate><atom:link href="https://bughht.github.io/categories/internship/index.xml" rel="self" type="application/rss+xml"/><item><title>Concomitant Field Simulation</title><link>https://bughht.github.io/intern_mgh/concomitant_sim/</link><pubDate>Sat, 20 Dec 2025 15:09:46 +0800</pubDate><author>hhong6@mgh.harvard.edu (Haotian Hong)</author><guid>https://bughht.github.io/intern_mgh/concomitant_sim/</guid><description>&lt;h1 id="mri-concomitant-field-simulation-tool"&gt;MRI Concomitant Field Simulation Tool&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;GitHub Repository&lt;/strong&gt;: &lt;a href="https://github.com/bughht/concomitant_sim"target="_blank" rel="external nofollow noopener noreferrer"&gt;bughht/concomitant_sim&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;code&gt;concomitant_sim&lt;/code&gt;&lt;/strong&gt; is a fast, backend-agnostic Python package for simulating the phase accumulation caused by concomitant fields (Maxwell Terms) in MRI. It enables high-performance computations on both CPU and GPU by natively supporting NumPy arrays, PyTorch tensors, and CuPy arrays. The library uses an intelligent dispatching mechanism to adapt array operations to your inputs seamlessly.&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="theoretical-modeling"&gt;Theoretical Modeling&lt;/h2&gt;
&lt;p&gt;The phase accumulation $\Phi_c$ caused by concomitant fields is modeled by integrating the magnetic field variation $\Delta B_c$ over time. Following the standard framework established by Bernstein et al. (1998), for a system with primary linear gradients, the concomitant field $B_c$ is approximated by second-order spatial terms:&lt;/p&gt;</description></item><item><title>ACDC Shim Waveform Optimization</title><link>https://bughht.github.io/intern_mgh/acdc_optim/</link><pubDate>Mon, 15 Dec 2025 15:09:46 +0800</pubDate><author>hhong6@mgh.harvard.edu (Haotian Hong)</author><guid>https://bughht.github.io/intern_mgh/acdc_optim/</guid><description>&lt;h1 id="shim-waveform-optimization-method-notes"&gt;Shim Waveform Optimization: Method Notes&lt;/h1&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;GitHub Repository&lt;/strong&gt;: &lt;a href="https://github.com/bughht/ACDC_Optim"target="_blank" rel="external nofollow noopener noreferrer"&gt;bughht/ACDC_Optim&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;We solve for shim coil currents that cancel a measured (or predicted) $B_0$ bias field,
subject to per-coil amplitude and total-current hardware limits. The codebase
(&lt;code&gt;ACDC_optimization.py&lt;/code&gt;) provides &lt;strong&gt;four solvers&lt;/strong&gt; for this problem, chosen according to
whether the currents are static or time-varying, and whether the amplifier chain&amp;rsquo;s
temporal response (SIRF) needs to be modeled:&lt;/p&gt;
&lt;p&gt;Naming scheme: &lt;code&gt;solve_shim_&amp;lt;scope&amp;gt;_&amp;lt;algorithm&amp;gt;&lt;/code&gt;.&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Function&lt;/th&gt;
					&lt;th&gt;Use case&lt;/th&gt;
					&lt;th&gt;Method&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;solve_shim_static_qp&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Single time frame&lt;/td&gt;
					&lt;td&gt;Exact QP (&lt;code&gt;quadprog&lt;/code&gt;, Goldfarb–Idnani)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;solve_shim_waveform_qp&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Waveform, &lt;strong&gt;no&lt;/strong&gt; SIRF coupling ($\mathbf{C}=\mathbf{I}$)&lt;/td&gt;
					&lt;td&gt;Exact QP per time point, parallelized (&lt;code&gt;joblib&lt;/code&gt;)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;solve_shim_waveform_fista&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Waveform, &lt;strong&gt;with&lt;/strong&gt; SIRF coupling&lt;/td&gt;
					&lt;td&gt;FISTA (NumPy, FFT-based &lt;code&gt;scipy.signal.convolve&lt;/code&gt;, or legacy dense $\mathbf{C}$)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;solve_shim_waveform_fista_torch&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Waveform, with SIRF, large $T$ / GPU&lt;/td&gt;
					&lt;td&gt;FISTA (PyTorch, FFT-based &lt;code&gt;conv1d&lt;/code&gt;, or legacy dense $\mathbf{C}$)&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;When the SIRF convolution can be neglected, per-time-point QP gives the &lt;em&gt;exact&lt;/em&gt; convex
optimum and is used directly (&lt;code&gt;solve_shim_waveform_qp&lt;/code&gt;). FISTA is only needed once the
temporal convolution matrix $\mathbf{C}$ couples time points together, since that removes
the block-diagonal structure that makes per-frame QP tractable.&lt;/p&gt;</description></item></channel></rss>