<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://megcore.nih.gov/index.php?action=history&amp;feed=atom&amp;title=3dNormalize</id>
	<title>3dNormalize - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://megcore.nih.gov/index.php?action=history&amp;feed=atom&amp;title=3dNormalize"/>
	<link rel="alternate" type="text/html" href="https://megcore.nih.gov/index.php?title=3dNormalize&amp;action=history"/>
	<updated>2026-05-18T07:19:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>https://megcore.nih.gov/index.php?title=3dNormalize&amp;diff=4475&amp;oldid=prev</id>
		<title>Tomh: /* Usage */</title>
		<link rel="alternate" type="text/html" href="https://megcore.nih.gov/index.php?title=3dNormalize&amp;diff=4475&amp;oldid=prev"/>
		<updated>2020-09-30T20:15:44Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Usage&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 16:15, 30 September 2020&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Usage ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Usage ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; 3dNormalize [-z] [-m subbrik] [-v] in out&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt; 3dNormalize [-z&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;] [-i&lt;/ins&gt;] [-m subbrik] [-v] in out&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here, &#039;&#039;in&#039;&#039; is the input SAM volume or BRIK file you&#039;d like to normalize. It may be a 3d+time BRIK, in which case the statistics are calculated across all subbriks. If a BRIK, it can be either +orig or +tlrc, and optionally compressed. The output is written as a BRIK to &#039;&#039;out&#039;&#039;.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Here, &#039;&#039;in&#039;&#039; is the input SAM volume or BRIK file you&#039;d like to normalize. It may be a 3d+time BRIK, in which case the statistics are calculated across all subbriks. If a BRIK, it can be either +orig or +tlrc, and optionally compressed. The output is written as a BRIK to &#039;&#039;out&#039;&#039;.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The -z option produces z-scores, and causes the output to have a mean of 0 and a standard deviation of 1. The default is to leave the mean the same, but to scale the SD. The -v option reports both values.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The -z option produces z-scores, and causes the output to have a mean of 0 and a standard deviation of 1. The default is to leave the mean the same, but to scale the SD. The -v option reports both values.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty diff-side-deleted&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The -i option scales the positive and negative tails independently.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;3dNormalize only operates on non-zero voxels. Voxels that are exactly zero are considered to be outside the head. To do this, a mask is generated from the non-zero voxels, by default from the first (or only) subbrik. The subbrik to use to generate the mask can be set with -m.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;3dNormalize only operates on non-zero voxels. Voxels that are exactly zero are considered to be outside the head. To do this, a mask is generated from the non-zero voxels, by default from the first (or only) subbrik. The subbrik to use to generate the mask can be set with -m.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Tomh</name></author>
	</entry>
	<entry>
		<id>https://megcore.nih.gov/index.php?title=3dNormalize&amp;diff=4474&amp;oldid=prev</id>
		<title>Tomh: 3dNormalize documentation</title>
		<link rel="alternate" type="text/html" href="https://megcore.nih.gov/index.php?title=3dNormalize&amp;diff=4474&amp;oldid=prev"/>
		<updated>2020-09-30T20:07:08Z</updated>

		<summary type="html">&lt;p&gt;3dNormalize documentation&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;3dNormalize&amp;#039;&amp;#039;&amp;#039; converts values in SAM output BRIK files into normalized versions, by dividing by the standard deviation. It can also work on .nii files.&lt;br /&gt;
&lt;br /&gt;
Normalization of some kind is often useful when comparing across subjects, and when the magnitude of the power change is not as important as where the power change is. If you are interested in the magnitude of the change (as a function of subject, probably), then you don&amp;#039;t want to normalize across subjects.&lt;br /&gt;
&lt;br /&gt;
3dNormalize is a shell script that also uses a small utility called &amp;#039;&amp;#039;&amp;#039;1dstats&amp;#039;&amp;#039;&amp;#039; (which is also included). 1dstats just computes statistics from values in a text file; you might find it useful for other purposes.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
 3dNormalize [-z] [-m subbrik] [-v] in out&lt;br /&gt;
&lt;br /&gt;
Here, &amp;#039;&amp;#039;in&amp;#039;&amp;#039; is the input SAM volume or BRIK file you&amp;#039;d like to normalize. It may be a 3d+time BRIK, in which case the statistics are calculated across all subbriks. If a BRIK, it can be either +orig or +tlrc, and optionally compressed. The output is written as a BRIK to &amp;#039;&amp;#039;out&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
The -z option produces z-scores, and causes the output to have a mean of 0 and a standard deviation of 1. The default is to leave the mean the same, but to scale the SD. The -v option reports both values.&lt;br /&gt;
&lt;br /&gt;
3dNormalize only operates on non-zero voxels. Voxels that are exactly zero are considered to be outside the head. To do this, a mask is generated from the non-zero voxels, by default from the first (or only) subbrik. The subbrik to use to generate the mask can be set with -m.&lt;br /&gt;
&lt;br /&gt;
== Q &amp;amp; A ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Q&amp;lt;/big&amp;gt; Should I use the -z option?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;A&amp;lt;/big&amp;gt; If you are comparing active and control conditions, you generally use a log-ratio, like so:&lt;br /&gt;
&lt;br /&gt;
 3dcalc -a ${a},3D_PWR,Mean.nii -b ${b},3D_PWR,Mean.nii -expr &amp;#039;log(a/b)&amp;#039; -prefix ${p}.nii&lt;br /&gt;
 3dNormalize -z ${p}.nii ${p}_z.nii&lt;br /&gt;
&lt;br /&gt;
where ${a} is the name of the active condition and ${b} is the name of the control.&lt;br /&gt;
&lt;br /&gt;
In this case, a value of zero has a very precise meaning: equal power levels. If you use -z to subtract the mean from the volume, zero will mean something else, and worse, a positive value, meaning active &amp;gt; control, might become a negative value, meaning control &amp;gt; active. Now, with that said, in general your SAM volumes should have a very normal looking distribution to start with (you can easily check this with 3dhistog), so removing the mean shouldn&amp;#039;t hurt, but then, it&amp;#039;s not necessary in that case.&lt;br /&gt;
&lt;br /&gt;
Additionally, if you have a state imbalance, removing the mean might be appropriate. Consider what happens if you have many more samples in the active condition than in the control condition. During the calculation of the covariance matrices, more samples means that covariance will converge more. Covariance converges up, so this means that there will be a bias towards more power in the active condition (the one with more samples). You may find that the resulting volume has all positive values, and no negative values at all. If the distribution is still normal (use 3dhistog), -z will fix the state imbalance.&lt;/div&gt;</summary>
		<author><name>Tomh</name></author>
	</entry>
</feed>