Skip to content

Commit 722b6d3

Browse files
committed
Add parameter to fix colorbar scaling for SNR map
Fixes #10
1 parent 46c5f4c commit 722b6d3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

coil_qa.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def main():
2626
parser.add_argument('--other-noise', type=str, help='Path to the raw noise data file of another coil part')
2727
# add scaling factor, defaulted to 100
2828
parser.add_argument('--scaling-factor', type=float, default=100, help='Scaling factor for the SNR map')
29+
# Add argument to specify the maximum value of the colorbar. No default value.
30+
parser.add_argument('--max-colorbar', type=float, help='Maximum value for the colorbar')
2931
args = parser.parse_args()
3032

3133
fname_image = args.fname_image
@@ -119,7 +121,11 @@ def main():
119121
snr_rss *= args.scaling_factor
120122

121123
plt.figure()
122-
plt.imshow(np.abs(snr_rss), cmap='jet', extent=extent)
124+
# display SNR map, and colorbar with max value specified by user, if provided
125+
if args.max_colorbar is not None:
126+
plt.imshow(np.abs(snr_rss), cmap='jet', extent=extent, vmax=args.max_colorbar)
127+
else:
128+
plt.imshow(np.abs(snr_rss), cmap='jet', extent=extent)
123129
plt.title('SNR map from RSS Combination')
124130
plt.colorbar()
125131
plt.savefig(f'{fname_image}_snr_rss.png')

0 commit comments

Comments
 (0)