<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; User Favorites: yichen</title>
		<link><a href='http://www.k-wave.org/forum/profile/yichen'>yichen</a></link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:39:12 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/profile/" rel="self" type="application/rss+xml" />

		<item>
			<title>quetaijiangchu on "Simulating ultrasound stimulation in the human brain"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-ultrasound-stimulation-in-the-human-brain#post-8856</link>
			<pubDate>Sat, 01 Jul 2023 10:47:06 +0000</pubDate>
			<dc:creator>quetaijiangchu</dc:creator>
			<guid isPermaLink="false">8856@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Can share this file if allowed('final_tissues.nii.gz')？
&#60;/p&#62;</description>
		</item>
		<item>
			<title>sky on "Simulating ultrasound stimulation in the human brain"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-ultrasound-stimulation-in-the-human-brain#post-8686</link>
			<pubDate>Tue, 13 Dec 2022 05:00:53 +0000</pubDate>
			<dc:creator>sky</dc:creator>
			<guid isPermaLink="false">8686@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;You can give me that file ('final_tissues.nii.gz'), and how do you run load_nii
&#60;/p&#62;</description>
		</item>
		<item>
			<title>yichen on "Simulating ultrasound stimulation in the human brain"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-ultrasound-stimulation-in-the-human-brain#post-8682</link>
			<pubDate>Thu, 01 Dec 2022 14:43:24 +0000</pubDate>
			<dc:creator>yichen</dc:creator>
			<guid isPermaLink="false">8682@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thank you Treeby! Your advice helps a lot!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Simulating ultrasound stimulation in the human brain"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-ultrasound-stimulation-in-the-human-brain#post-8681</link>
			<pubDate>Wed, 30 Nov 2022 21:35:09 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8681@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Broadly speaking, that sounds right. See &#60;a href=&#34;//www.k-wave.org/documentation/makeBowl.php”&#34;&#62;the docs&#60;/a&#62;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>yichen on "Simulating ultrasound stimulation in the human brain"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-ultrasound-stimulation-in-the-human-brain#post-8680</link>
			<pubDate>Wed, 30 Nov 2022 08:48:18 +0000</pubDate>
			<dc:creator>yichen</dc:creator>
			<guid isPermaLink="false">8680@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thank you Treeby. I think it's the issue of CFL setting resulting in instability.&#60;/p&#62;
&#60;p&#62;After I reduced the CFL from 0.3 to 0.2, the simulation became reasonable.&#60;/p&#62;
&#60;p&#62;I have one more question regarding the setting of the ultrasound focus. I used makeBowl to generate an ultrasound transducer, which required several parameters to define the transducer. In the code below, could you please kindly check if I have set each parameter properly, as to what these parameters actually stand for?&#60;/p&#62;
&#60;p&#62;%% define the transducer&#60;br /&#62;
radius = round(64e-3/dx); %transducer curvature in grid step&#60;br /&#62;
diameter = round(64e-3/dx)+1; %transducer diameter in grid step&#60;br /&#62;
pos_transducer = [96, 170 ,211]; %where to put the transducer&#60;br /&#62;
focus_transducer = [96, 148, 167]; %where the ultrasound to be focused&#60;br /&#62;
source.p_mask = makeBowl([Nx, Ny, Nz], pos_transducer, ...&#60;br /&#62;
radius, diameter, focus_transducer, 'Plot', false);&#60;/p&#62;
&#60;p&#62;To my understanding, the input 'radius' and 'diameter' to the 'makeBowl' function stand for the physical property of the transducer, so these two parameters should be fixed regarding one specific transducer.&#60;br /&#62;
As to the 'pos_transducer', it refers to the coordinate of the center of the transducer.&#60;br /&#62;
As to the 'focus_transducer', it refers to the coordinate of the brain region we are intended to stimulate.&#60;/p&#62;
&#60;p&#62;Thanks again for your assistance!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>yichen on "Simulating ultrasound stimulation in the human brain"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-ultrasound-stimulation-in-the-human-brain#post-8679</link>
			<pubDate>Wed, 30 Nov 2022 05:30:16 +0000</pubDate>
			<dc:creator>yichen</dc:creator>
			<guid isPermaLink="false">8679@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thanks for your reply. I'll try with reducing CFL and get back to you later.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Simulating ultrasound stimulation in the human brain"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-ultrasound-stimulation-in-the-human-brain#post-8678</link>
			<pubDate>Tue, 29 Nov 2022 22:43:29 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8678@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I haven't run your simulation, but it looks a lot like classic instability. Does it work if you reduce the CFL?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>yichen on "Simulating ultrasound stimulation in the human brain"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-ultrasound-stimulation-in-the-human-brain#post-8677</link>
			<pubDate>Tue, 29 Nov 2022 19:22:40 +0000</pubDate>
			<dc:creator>yichen</dc:creator>
			<guid isPermaLink="false">8677@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Treeby and colleagues,&#60;/p&#62;
&#60;p&#62;I am trying to simulate ultrasound stimulation in the human brain.&#60;br /&#62;
I defined the Kgrid as the size of T1 weighted image, in this case, 192*256*256, with dx=dy=dz=0.8e-3.&#60;br /&#62;
I defined the medium using segmentation result which separate skull, soft tissue and scalp, and set each density, sound_speed and alpha_coeff according to literatures.&#60;br /&#62;
I set up the source using makeBowl function to mimic a ultrasound transducer.&#60;br /&#62;
I set up the sensor so that it covers the whole Kgrid.&#60;br /&#62;
I set up the input signal as what 'example_diff_focused_ultrasound_heating' did.&#60;/p&#62;
&#60;p&#62;The simulation worked well at the first half of computing, while went very strange during the second half, as shown in the figure below.&#60;br /&#62;
The following two figures show how the simulation result changes over time. You can access to the figure by the URL.&#60;br /&#62;
&#60;a href=&#34;https://ibb.co/d60B7ch&#34; rel=&#34;nofollow&#34;&#62;https://ibb.co/d60B7ch&#60;/a&#62;&#60;br /&#62;
&#60;a href=&#34;https://ibb.co/LRFQDS0&#34; rel=&#34;nofollow&#34;&#62;https://ibb.co/LRFQDS0&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;This only happens when I introduced the skull into medium.&#60;br /&#62;
Once I removed the skull from the medium, i.e., left the skull part as free water, the simulation became reasonable.&#60;br /&#62;
The simulation also works well if I select one X-Y plane and do a 2D simulation, with skull defined in medium.&#60;/p&#62;
&#60;p&#62;Can you advise what maight account for the strange simulation result above, and how I can modify my code to fix things? I have attached my code for simulation below. Can you also have a look on it? Thanks in advance!&#60;/p&#62;
&#60;p&#62;P.S.:If you need the segmentation file for replication, please tell me and I'll upload it to somewhere like the google drive.&#60;/p&#62;
&#60;p&#62;%% Code for simulation&#60;br /&#62;
clear; close all; clc;&#60;br /&#62;
%% get segmentation&#60;br /&#62;
T1_nii = load_nii('final_tissues.nii.gz');&#60;br /&#62;
T1_recon = T1_nii.img;&#60;br /&#62;
%% specify K-grid&#60;br /&#62;
Nx = size(T1_recon,1); Ny = size(T1_recon,2); Nz = size(T1_recon,3); %get T1WI resolution&#60;br /&#62;
%x - 1:left to max:right, y - 1:back to max:front, z - 1:bottom to max:top&#60;br /&#62;
dx = 0.8e-3; dy = 0.8e-3; dz = 0.8e-3; %get T1WI step&#60;br /&#62;
if ~rem(Ny,2)&#60;br /&#62;
    center_y = Ny/2;&#60;br /&#62;
else&#60;br /&#62;
    center_y = (Ny+1)/2;&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;if ~rem(Nz,2)&#60;br /&#62;
    center_z = Nz/2;&#60;br /&#62;
else&#60;br /&#62;
    center_z = (Nz+1)/2;&#60;br /&#62;
end&#60;br /&#62;
% create the computational grid&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy, Nz, dz);&#60;br /&#62;
%% specify medium, parameter from Fomenko et al., 2020, Elife&#60;br /&#62;
medium.density = 1000.*ones(Nx, Ny, Nz);&#60;br /&#62;
medium.sound_speed = 1482.*ones(Nx, Ny, Nz);&#60;br /&#62;
medium.alpha_coeff = 0.21.*ones(Nx, Ny, Nz);&#60;br /&#62;
medium.alpha_power = 1.1;&#60;br /&#62;
medium.alpha_mode  = 'no_dispersion';&#60;br /&#62;
% brain tissues, gm&#38;amp;wm&#60;br /&#62;
medium.density(T1_recon==1&#124;T1_recon==2) = 1040;&#60;br /&#62;
medium.sound_speed(T1_recon==1&#124;T1_recon==2) = 1552;&#60;br /&#62;
medium.alpha_coeff(T1_recon==1&#124;T1_recon==2) = 0.21;&#60;br /&#62;
% scalp&#60;br /&#62;
medium.density(T1_recon==5) = 1100;&#60;br /&#62;
medium.sound_speed(T1_recon==5) = 1732;&#60;br /&#62;
medium.alpha_coeff(T1_recon==5) = 0.21;&#60;br /&#62;
% bone&#60;br /&#62;
% medium.density(T1_recon==7&#124;T1_recon==8) = 1732;&#60;br /&#62;
% medium.sound_speed(T1_recon==7&#124;T1_recon==8) = 2850;&#60;br /&#62;
% medium.alpha_coeff(T1_recon==7&#124;T1_recon==8) = 2.7;&#60;br /&#62;
%% define the transucer&#60;br /&#62;
aperture_grid = round(64e-3/dx)+1;&#60;br /&#62;
curvature_grid = round(64e-3/dx);&#60;br /&#62;
pos_transducer = [1, center_y ,center_z]; %where to put the transducer&#60;br /&#62;
source.p_mask = makeBowl([Nx, Ny, Nz], pos_transducer, ...&#60;br /&#62;
    curvature_grid, aperture_grid, [curvature_grid, center_y, center_z], 'Plot', true);&#60;br /&#62;
%% define input signal&#60;br /&#62;
% define the acoustic parameters&#60;br /&#62;
freq = 5e5; % [Hz] 500KHz&#60;br /&#62;
amp  = 0.5e6; % [Pa]&#60;/p&#62;
&#60;p&#62;% calculate the time step using an integer number of points per period&#60;br /&#62;
sound_speed = 1482;              % [m/s]&#60;br /&#62;
ppw = sound_speed / (freq * dx); % points per wavelength&#60;br /&#62;
cfl = 0.3;                       % cfl number&#60;br /&#62;
ppp = ceil(ppw / cfl);           % points per period&#60;br /&#62;
T   = 1 / freq;                  % period [s]&#60;br /&#62;
dt  = T / ppp;                   % time step [s]&#60;/p&#62;
&#60;p&#62;% calculate the number of time steps to reach steady state&#60;br /&#62;
t_end = sqrt( kgrid.x_size.^2 + kgrid.y_size.^2 + kgrid.z_size.^2 ) / sound_speed;&#60;br /&#62;
Nt = round(t_end / dt);&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
kgrid.setTime(Nt, dt);&#60;/p&#62;
&#60;p&#62;% define the input signal&#60;br /&#62;
source.p = createCWSignals(kgrid.t_array, freq, amp, 0, 0); % ramp_length=0&#60;/p&#62;
&#60;p&#62;% figure;&#60;br /&#62;
% plot(source.p);&#60;/p&#62;
&#60;p&#62;%% define the sensor mask&#60;br /&#62;
% set the sensor mask to cover the entire grid&#60;br /&#62;
sensor.mask = ones(Nx, Ny, Nz);&#60;br /&#62;
% sensor.record = {'p', 'p_max_all', 'I', 'I_avg'};&#60;br /&#62;
sensor.record = {'p', 'p_max_all'};&#60;/p&#62;
&#60;p&#62;%% run simulation&#60;br /&#62;
% record the last 3 cycles in steady state&#60;br /&#62;
num_periods = 3;&#60;br /&#62;
T_points = round(num_periods * T / kgrid.dt);&#60;br /&#62;
sensor.record_start_index = Nt - T_points + 1;&#60;/p&#62;
&#60;p&#62;% set the input arguements&#60;br /&#62;
input_args = {'PMLInside', false, 'PlotPML', false, 'PMLAlpha', 1e6, 'DisplayMask', ...&#60;br /&#62;
    'off', 'PlotScale', [-1, 1] * amp, 'Smooth', [false, true, true]};&#60;/p&#62;
&#60;p&#62;% run the acoustic simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
