本文整理汇总了Python中numpy.rot90函数的典型用法代码示例。如果您正苦于以下问题:Python rot90函数的具体用法?Python rot90怎么用?Python rot90使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rot90函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: generate_image
def generate_image(data, is_partial=False, content_range=None):
fig = plt.figure()
if data.ndim == 1:
plt.plot(data)
elif data.ndim == 2:
data = np.asarray(data).real
mat = plt.matshow(np.rot90(data), cmap=plt.cm.viridis)
mat.axes.get_xaxis().set_visible(False)
mat.axes.get_yaxis().set_visible(False)
elif data.ndim == 3 and data.shape[-1] in (3, 4):
data = np.array(data)
mat = plt.imshow(np.rot90(data))
mat.axes.get_xaxis().set_visible(False)
mat.axes.get_yaxis().set_visible(False)
else:
raise ValueError('cannot handle dimensions > 3')
bio = BytesIO()
plt.savefig(bio, bbox_inches='tight', pad_inches=0, format='png')
bio.seek(0)
fig.clf()
plt.close('all')
return TempResult(
bio.read(),
'image/png',
is_partial=is_partial,
content_range=content_range)
开发者ID:JohnVinyard,项目名称:zounds,代码行数:26,代码来源:serializer.py
示例2: displayFrame
def displayFrame(self, update_locs):
if self.movie_file:
# Get the current frame.
frame = self.movie_file.loadAFrame(self.cur_frame).astype(numpy.float)
if self.ui.oriCheckBox.isChecked():
frame = numpy.rot90(numpy.rot90(frame))
else:
frame = numpy.transpose(frame)
# Create the 3D-DAOSTORM molecule items.
nm_per_pixel = self.ui.nmPerPixelSpinBox.value()
multi_mols = []
if update_locs and self.multi_list:
multi_mols = self.multi_list.createMolItems(self.cur_frame+1, nm_per_pixel)
# Create the Insight3 molecule items.
i3_mols = []
if update_locs and self.i3_list:
i3_mols = self.i3_list.createMolItems(self.cur_frame+1, nm_per_pixel)
self.movie_view.newFrame(frame,
multi_mols,
i3_mols,
self.ui.minSpinBox.value(),
self.ui.maxSpinBox.value())
开发者ID:fnzhanghao,项目名称:storm-analysis,代码行数:27,代码来源:visualizer.py
示例3: rotate_data
def rotate_data(bg, overlay, slices_list, axis_name, shape):
# Rotate the data as required
# Return the rotated data, and an updated slice list if necessary
if axis_name == 'axial':
# Align so that right is right
overlay = np.rot90(overlay)
overlay = np.fliplr(overlay)
bg = np.rot90(bg)
bg = np.fliplr(bg)
elif axis_name == 'coronal':
overlay = np.rot90(overlay)
bg = np.rot90(bg)
overlay = np.flipud(np.swapaxes(overlay, 0, 2))
bg = np.flipud(np.swapaxes(bg, 0, 2))
slices_list[1] = [ shape - n - 3 for n in slices_list[1] ]
elif axis_name == 'sagittal':
overlay = np.flipud(np.swapaxes(overlay, 0, 2))
bg = np.flipud(np.swapaxes(bg, 0, 2))
else:
print '\n************************'
print 'ERROR: data could not be rotated\n'
parser.print_help()
sys.exit()
return bg, overlay, slices_list
开发者ID:KirstieJane,项目名称:DESCRIBING_DATA,代码行数:28,代码来源:MakePngs_DTI.py
示例4: modulatePF_unwrapped
def modulatePF_unwrapped(self):
#geometry = self._control.slm.getGeometry()
geometry = self._getGeo()
MOD = -1*self.unwrap()
MOD = np.flipud(MOD)
MOD = np.rot90(MOD)
cx,cy,d = geometry.cx, geometry.cy, geometry.d
# Diameter of phase retrieval output [pxl]:
dPhRt = (self._pupil.k_max/self._pupil.kx.max())*self._pupil.nx
# Zoom needed to fit onto SLM map:
zoom = d/dPhRt
MOD = interpolation.zoom(MOD,zoom,order=0,mode='nearest')
# Flip up down:
#MOD = np.flipud(MOD)
# Flip left right:
#MOD = np.fliplr(MOD)
#MOD = np.rot90(MOD)
MOD = np.rot90(-1.0*MOD) #Invert and rot90
# Shift center:
MOD = interpolation.shift(MOD,(cy-255.5,cx-255.5),order=0,
mode='nearest')
# Cut out center 512x512:
c = MOD.shape[0]/2
MOD = MOD[c-256:c+256,c-256:c+256]
# Add an 'Other' modulation using the SLM API. Store the index in _modulations:
#index = self._control.slm.addOther(MOD)
index = self._addMOD(MOD)
self._modulations.append(index)
return index
开发者ID:coder-guy22296,项目名称:Device_manager,代码行数:31,代码来源:adaptiveOptics_v0.py
示例5: do_cut
def do_cut(self, map, affine):
""" Cut the 3D volume into a 2D slice
Parameters
==========
map: 3D ndarray
The 3D volume to cut
affine: 4x4 ndarray
The affine of the volume
"""
coords = [0, 0, 0]
coords['yxz'.index(self.direction)] = self.coord
x_map, y_map, z_map = [int(round(c)) for c in
coord_transform(coords[0],
coords[1],
coords[2],
np.linalg.inv(affine))]
if self.direction == 'x':
cut = np.rot90(map[:, y_map, :])
elif self.direction == 'y':
cut = np.rot90(map[x_map, :, :])
elif self.direction == 'z':
cut = np.rot90(map[:, :, z_map])
else:
raise ValueError('Invalid value for direction %s' %
self.direction)
return cut
开发者ID:chrisfilo,项目名称:nipy,代码行数:27,代码来源:slicers.py
示例6: findRotationScaleTranslation
def findRotationScaleTranslation(image1, image2, window=None, highpass=None):
image1 = normalize(image1)
image2 = normalize(image2)
rotation, scale, rsvalue = findRotationScale(image1, image2, window, highpass)
shape = image2.shape[0]*2, image2.shape[1]*2
r = rotateScaleOffset(image2, -rotation, 1.0/scale, (0.0, 0.0), shape)
o = ((shape[0] - image1.shape[0])/2, (shape[1] - image1.shape[1])/2)
i = numpy.zeros(shape, image1.dtype)
i[o[0]:o[0] + image1.shape[0], o[1]:o[1] + image1.shape[1]] = image1
fft1 = numpy.fft.rfft2(i)
fft2 = numpy.fft.rfft2(r)
pc = phaseCorrelate(fft1, fft2, fft=True)
peak, value = findPeak(pc)
r180 = numpy.rot90(numpy.rot90(r))
fft2 = numpy.fft.rfft2(r180)
pc = phaseCorrelate(fft1, fft2, fft=True)
peak180, value180 = findPeak(pc)
if value < value180:
peak = peak180
value = value180
rotation = (rotation + 180.0) % 360.0
r = r180
return rotation, scale, peak, rsvalue, value
开发者ID:kraftp,项目名称:Leginon-Feature-Detection-Modification,代码行数:31,代码来源:align.py
示例7: plot_spectrogram
def plot_spectrogram(pred_spectrogram, path, info=None, split_title=False, target_spectrogram=None, max_len=None):
if max_len is not None:
target_spectrogram = target_spectrogram[:max_len]
pred_spectrogram = pred_spectrogram[:max_len]
if info is not None:
if split_title:
title = split_title_line(info)
else:
title = info
fig = plt.figure(figsize=(10, 8))
# Set common labels
fig.text(0.5, 0.18, title, horizontalalignment='center', fontsize=16)
#target spectrogram subplot
if target_spectrogram is not None:
ax1 = fig.add_subplot(311)
ax2 = fig.add_subplot(312)
im = ax1.imshow(np.rot90(target_spectrogram), interpolation='none')
ax1.set_title('Target Mel-Spectrogram')
fig.colorbar(mappable=im, shrink=0.65, orientation='horizontal', ax=ax1)
ax2.set_title('Predicted Mel-Spectrogram')
else:
ax2 = fig.add_subplot(211)
im = ax2.imshow(np.rot90(pred_spectrogram), interpolation='none')
fig.colorbar(mappable=im, shrink=0.65, orientation='horizontal', ax=ax2)
plt.tight_layout()
plt.savefig(path, format='png')
plt.close()
开发者ID:duvtedudug,项目名称:Tacotron-2,代码行数:33,代码来源:plot.py
示例8: _axialShow
def _axialShow(data, slice, overlay = False,
surface = None):
"""
similar to _coronalshow
"""
if not overlay:
plt.imshow(np.rot90(data[:, slice, :], k=1),
cmap = plt.cm.gray , aspect = 'auto',
interpolation = 'nearest')
if overlay:
overlayD = np.ma.masked_array(data, data == 0)
if surface =='wm':
plt.imshow(np.rot90(overlayD[:, slice, :], k=1),
cmap = plt.cm.Reds, vmax = 1.2, vmin = 0,
aspect = 'auto',
interpolation = 'nearest')
if surface == 'pial':
plt.imshow(np.rot90(overlayD[:, slice, :], k=1),
cmap = plt.cm.hot, vmax = 1.2, vmin = 0,
aspect = 'auto',
interpolation = 'nearest')
return None
开发者ID:armaneshaghi,项目名称:DCMPy,代码行数:26,代码来源:mri.py
示例9: strel
def strel(l,d):
print 'strel(',l,',',d,')'
def _get_rect_shape(l):
if l % 2 == 0:
l+=1
return l,l
w,h = _get_rect_shape(l)
d = float(d)
m = math.tan(math.radians(d))
if d <= 45.0:
x1 = w
y1 = m*x1
_line = line
elif d <= 90.0:
y1 = h
x1 = y1 / m
_line = line2
elif d <= 180.0:
output = strel(l, d-90.0)
return np.rot90(output)
m = np.zeros((w,h))
x1,y1 = int(math.ceil(x1)), int(math.ceil(y1))
for x,y in _line(0,0,x1,y1):
m[x][y] = 1
m = np.rot90(m)
output = np.zeros(m.shape, dtype=np.uint8)
output[0:w/2+1, h/2:h] = m[w/2:w+1, 0:h/2+1]
output[w/2:w+1, 0:h/2+1] = np.rot90(output[0:w/2+1, h/2:h],2)
return output
开发者ID:felipeblassioli,项目名称:MAC0499,代码行数:32,代码来源:grabed.py
示例10: _load_textures
def _load_textures(self):
marker_one_textures = {}
marker_two_textures = {}
# load images
image_green = cv2.imread('{}green.png'.format(self.FILE_PATH))
image_yellow = cv2.imread('{}yellow.png'.format(self.FILE_PATH))
image_blue = cv2.imread('{}blue.png'.format(self.FILE_PATH))
image_pink = cv2.imread('{}pink.png'.format(self.FILE_PATH))
image_saltwash = np.rot90(cv2.imread('{}saltwash.jpg'.format(self.FILE_PATH)), 2)
image_halo = np.rot90(cv2.imread('{}halo.jpg'.format(self.FILE_PATH)), 2)
# load textures for marker one
marker_one_textures[TEXTURE_FRONT] = None
marker_one_textures[TEXTURE_RIGHT] = image_green
marker_one_textures[TEXTURE_BACK] = image_yellow
marker_one_textures[TEXTURE_LEFT] = image_blue
marker_one_textures[TEXTURE_TOP] = image_pink
# load textures for marker two
marker_two_textures[TEXTURE_FRONT] = image_saltwash
marker_two_textures[TEXTURE_RIGHT] = image_green
marker_two_textures[TEXTURE_BACK] = image_halo
marker_two_textures[TEXTURE_LEFT] = image_blue
marker_two_textures[TEXTURE_TOP] = image_pink
return (marker_one_textures, marker_two_textures)
开发者ID:dash-ak,项目名称:ArkwoodAR,代码行数:27,代码来源:mediacube.py
示例11: _coronalShow
def _coronalShow(data, slice, overlay = False,
surface = None):
"""
function to plot T1 volume and pial/WM surfaces
data: nibabel loaded numpy array
slice: integer indicating number of the desired slice
overlay: boolean indicating whether the data is an overlay or not
surface: string indicating what kind of surface is overlay (wm or pial)
"""
if not overlay:
plt.imshow(np.rot90(data[:, :, slice], k=3),
cmap = plt.cm.gray , aspect = 'auto',
interpolation = 'nearest')
if overlay:
overlayD = np.ma.masked_array(data, data == 0)
if surface =='wm':
plt.imshow(np.rot90(overlayD[:,:, slice], k=3),
cmap = plt.cm.Reds, vmax = 1.2, vmin = 0,
aspect = 'auto',
interpolation = 'nearest')
if surface == 'pial':
plt.imshow(np.rot90(overlayD[:, :, slice], k=3),
cmap = plt.cm.hot, vmax = 1.2, vmin = 0,
aspect = 'auto',
interpolation = 'nearest')
return None
开发者ID:armaneshaghi,项目名称:DCMPy,代码行数:31,代码来源:mri.py
示例12: get_chunk_info
def get_chunk_info(self,closeFile = True):
"""Preloads region header information."""
if self._locations:
return
self.openfile()
self._chunks = None
self._locations = [0]*32*32
self._timestamps = []
# go to the beginning of the file
self._file.seek(0)
# read chunk location table
locations_index = numpy.reshape(numpy.rot90(numpy.reshape(range(32*32),
(32, 32)), -self.get_north_rotations()), -1)
for i in locations_index:
self._locations[i] = self._read_chunk_location()
# read chunk timestamp table
timestamp_append = self._timestamps.append
for _ in xrange(32*32):
timestamp_append(self._read_chunk_timestamp())
self._timestamps = numpy.reshape(numpy.rot90(numpy.reshape(
self._timestamps, (32,32)),self.get_north_rotations()), -1)
if closeFile:
self.closefile()
return
开发者ID:Psykar,项目名称:Minecraft-Overviewer,代码行数:31,代码来源:nbt.py
示例13: get_boundry
def get_boundry(pix, width, height):
start = True
finished = False
north = True
xVar = 0
initialCoord = [1, 1]
coord = initialCoord
boundryArr = []
var = 5 # number of pixels to jump accross when filtering
while finished < 4:
coord = search_north_border(pix, width, height, coord, boundryArr) #starting from the north direction
if coord == [0,0]:
xVar += var
coord = [1, xVar]
else:
boundryArr.append(coord) #if it wasn't in a bad position append it
pix[coord[0]][coord[1]] = 500
if xVar >= width:
finished += 1 #completes one more rotation
coord = initialCoord #start from the beginning again
np.rot90(pix) #rotate the image by 90 degrees to begin searching again
nextDir = 'NE' # reinitialise directions
prevDir = ['NE', 'NE', 'NE'] # want the border to search up and away from edge first
temp = height
height = width
width = temp #change the orientation of height and width
pix = process_boundry(pix, width, height, boundryArr)
# print boundryArr
return pix
开发者ID:ArianeMora,项目名称:gusto-mri-noise-filter,代码行数:30,代码来源:filter.py
示例14: random_rotation_90
def random_rotation_90(channels, gt_lbls, probs_rot_90=None):
# Rotate by 0/90/180/270 degrees.
# channels: list (x pathways) of np arrays [channels, x, y, z]. Whole volumes, channels of a case.
# gt_lbls: np array of shape [x,y,z]
# probs_rot_90: {'xy': {'0': fl, '90': fl, '180': fl, '270': fl},
# 'yz': {'0': fl, '90': fl, '180': fl, '270': fl},
# 'xz': {'0': fl, '90': fl, '180': fl, '270': fl} }
if probs_rot_90 is None:
return channels, gt_lbls
for key, plane_axes in zip( ['xy', 'yz', 'xz'], [(0,1), (1,2), (0,2)] ) :
probs_plane = probs_rot_90[key]
if probs_plane is None:
continue
assert len(probs_plane) == 4 # rotation 0, rotation 90 degrees, 180, 270.
assert channels[0].shape[1+plane_axes[0]] == channels[0].shape[1+plane_axes[1]] # +1 cause [0] is channel. Image/patch must be isotropic.
# Normalize probs
sum_p = probs_plane['0'] + probs_plane['90'] + probs_plane['180'] + probs_plane['270']
if sum_p == 0:
continue
for rot_k in probs_plane:
probs_plane[rot_k] /= sum_p # normalize p to 1.
p_rot_90_x0123 = ( probs_plane['0'], probs_plane['90'], probs_plane['180'], probs_plane['270'] )
rot_90_xtimes = np.random.choice(a=(0,1,2,3), size=1, p=p_rot_90_x0123)
for path_idx in range(len(channels)):
channels[path_idx] = np.rot90(channels[path_idx], k=rot_90_xtimes, axes = [axis+1 for axis in plane_axes]) # + 1 cause [0] is channels.
gt_lbls = np.rot90(gt_lbls, k=rot_90_xtimes, axes = plane_axes)
return channels, gt_lbls
开发者ID:Kamnitsask,项目名称:deepmedic,代码行数:33,代码来源:augmentation.py
示例15: save_3plane_vertical
def save_3plane_vertical(self, X_cut, Y_cut, Z_cut, savefile):
fig = pylab.figure(figsize=(4,3))
for image in self.image_list:
fig.add_subplot(3,1,1) ##### AXIAL
plt.imshow(np.rot90(image[0][self.xmin:self.xmax,self.ymin:self.ymax, Z_cut],3),
cmap=image[1], vmax=image[2], vmin=image[3], alpha=image[4],
extent=[0, self.x_trans*(self.xmax - self.xmin),
0, self.y_trans*(self.ymax - self.ymin)],
origin='lower')
plt.axis('off')
fig.add_subplot(3,1,2) ##### COR
plt.imshow(np.rot90(image[0][self.xmin:self.xmax, Y_cut,self.zmin:self.zmax],3),
cmap=image[1], vmax=image[2], vmin=image[3], alpha=image[4],
extent=[0, self.x_trans*(self.xmax - self.xmin),
0, self.z_trans*(self.zmax - self.zmin)],
origin='lower')
plt.axis('off')
fig.add_subplot(3,1,3) #### SAG
plt.imshow(np.rot90(image[0][X_cut,self.ymin:self.ymax,self.zmin:self.zmax],3),
cmap=image[1], vmax=image[2], vmin=image[3], alpha=image[4],
extent=[0,self.y_trans*(self.ymax - self.ymin),
0, self.z_trans*(self.zmax - self.zmin)],
origin='lower')
plt.axis('off')
plt.savefig(savefile, dpi=500, facecolor=[0,0,0], bbox_inches=None,
pad_inches=0)
plt.close()
开发者ID:PIRCImagingTools,项目名称:sfDM,代码行数:30,代码来源:map_maker.py
示例16: back_propagation
def back_propagation(self, x, y):
"""Propagate errors, computing the gradients of the weights and biases.
"""
nabla_w = [np.zeros(w.shape) for w in self.weights]
nabla_b = [np.zeros(b.shape) for b in self.biases]
# feedforward
output = x.reshape(28, 28, -1)
os = [output]
for k, W, b in zip(self.layers, self.weights, self.biases):
output = op.add_bias(
op.conv(output, W, stride=k[1], padding=k[2]), b)
os.append(output)
# Backward error propagation.
# Restore tensor to kernels shape.
delta = self.output_delta.reshape((28, 28, -1))
nabla_b[-1] = op.sum(op.sum(delta, axis=0), axis=0)
nabla_w[-1] = np.rot90(op.conv(np.rot90(os[-2], k=2), delta), k=2)
for l in range(2, self.n_layers + 1):
w = self.weights[-l]
delta = op.conv(delta, np.rot90(w, k=2))
nabla_b[-l] = op.sum(op.sum(delta, axis=0), axis=0)
nabla_w[-l] = np.rot90(op.conv(np.rot90(os[-l - 1], k=2), delta),
k=2)
return nabla_b, nabla_w, delta
开发者ID:finardi,项目名称:convolutional-cuda,代码行数:32,代码来源:convolutional.py
示例17: doit
def doit(
filename, raten=25, rated=1, aspectn=1, aspectd=1, rotate_180=False # numerator # denom # numerator # denom
):
fmf = FMF.FlyMovie(filename)
if fmf.get_format() not in ["MONO8", "RAW8"]:
raise NotImplementedError("Only MONO8 and RAW8 formats are currently supported.")
width = fmf.get_width() // (fmf.get_bits_per_pixel() // 8)
height = fmf.get_height()
Y4M_MAGIC = "YUV4MPEG2"
Y4M_FRAME_MAGIC = "FRAME"
inter = "Ip" # progressive
colorspace = "Cmono"
out_fd = sys.stdout
out_fd.write(
"%(Y4M_MAGIC)s W%(width)d H%(height)d F%(raten)d:%(rated)d %(inter)s A%(aspectn)d:%(aspectd)d %(colorspace)s\n"
% locals()
)
while 1:
try:
frame, timestamp = fmf.get_next_frame()
except FMF.NoMoreFramesException, err:
break
out_fd.write("%(Y4M_FRAME_MAGIC)s\n" % locals())
if rotate_180:
frame = numpy.rot90(numpy.rot90(frame))
for i in range(height):
out_fd.write(frame[i, :].tostring())
out_fd.flush()
开发者ID:ptweir,项目名称:flymovieformat,代码行数:35,代码来源:fmfcat.py
示例18: depthwise_conv2d_python_nhwc
def depthwise_conv2d_python_nhwc(input_np, filter_np, stride, padding):
"""Depthwise convolution operator in nchw layout.
Parameters
----------
input_np : numpy.ndarray
4-D with shape [batch, in_height, in_width, in_channel]
filter_np : numpy.ndarray
4-D with shape [filter_height, filter_width, in_channel, channel_multiplier]
stride : list / tuple of 2 ints
[stride_height, stride_width]
padding : str
'VALID' or 'SAME'
Returns
-------
output_np : np.ndarray
4-D with shape [batch, out_height, out_width, out_channel]
"""
batch, in_height, in_width, in_channel = input_np.shape
filter_height, filter_width, _, channel_multiplier = filter_np.shape
if isinstance(stride, int):
stride_h = stride_w = stride
else:
stride_h, stride_w = stride
# calculate output shape
if padding == 'VALID':
out_channel = in_channel * channel_multiplier
out_height = (in_height - filter_height) // stride_h + 1
out_width = (in_width - filter_width) // stride_w + 1
output_np = np.zeros((batch, out_height, out_width, out_channel))
for i in range(batch):
for j in range(out_channel):
output_np[i, :, :, j] = signal.convolve2d(input_np[i, :, :, j//channel_multiplier], \
np.rot90(filter_np[:, :, j//channel_multiplier, j%channel_multiplier], 2), \
mode='valid')[0:(in_height - filter_height + 1):stride_h, 0:(in_width - filter_height + 1):stride_w]
if padding == 'SAME':
out_channel = in_channel * channel_multiplier
out_height = np.int(np.ceil(float(in_height) / float(stride_h)))
out_width = np.int(np.ceil(float(in_width) / float(stride_w)))
output_np = np.zeros((batch, out_height, out_width, out_channel))
pad_along_height = np.int(np.max((out_height - 1) * stride_h + filter_height - in_height, 0))
pad_along_width = np.int(np.max((out_width - 1) * stride_w + filter_width - in_width, 0))
pad_top_tvm = np.int(np.ceil(float(pad_along_height) / 2))
pad_left_tvm = np.int(np.ceil(float(pad_along_width) / 2))
pad_top_scipy = np.int(np.ceil(float(filter_height - 1) / 2))
pad_left_scipy = np.int(np.ceil(float(filter_width - 1) / 2))
index_h = pad_top_scipy - pad_top_tvm
index_w = pad_left_scipy - pad_left_tvm
for i in range(batch):
for j in range(out_channel):
output_np[i, :, :, j] = signal.convolve2d(input_np[i, :, :, j//channel_multiplier], \
np.rot90(filter_np[:, :, j//channel_multiplier, j%channel_multiplier], 2), \
mode='same')[index_h:in_height:stride_h, index_w:in_width:stride_w]
return output_np
开发者ID:bddppq,项目名称:tvm,代码行数:60,代码来源:depthwise_conv2d_python.py
示例19: data_reorient_udrot
def data_reorient_udrot(d, pl, ud=None, rot90=None):
"""
"""
print >>sys.stderr, "Reorienting...",
if (not ud is None) and (not rot90 is None):
if ud > 0:
d = np.flipud(d)
if rot90 > 0:
d = np.rot90(d, rot90)
print >>sys.stderr, "done."
return d
ud = pl.get_val('REORIENT_CCD_FLIPUD')
if ud == None:
ud = pl.get_val('CORRECTION_FLIPUD')
ud = int(ud)
rot90 = pl.get_val('REORIENT_CCD_ROT90')
if rot90 == None:
rot90 = pl.get_val('CORRECTION_ROTATION')
rot90 = int(rot90)
if ud > 0:
d = np.flipud(d)
if rot90 > 0:
d = np.rot90(d, rot90)
print >>sys.stderr, "done."
return d
开发者ID:Venki-Kavuri,项目名称:bopy,代码行数:26,代码来源:transform.py
示例20: display_mask
def display_mask(background, mask, title):
plt.axis('off')
plt.imshow(np.rot90(background), interpolation='nearest', cmap=plt.cm.gray)
ma = np.ma.masked_equal(mask, False)
plt.imshow(np.rot90(ma), interpolation='nearest',
cmap=plt.cm.autumn, alpha=0.5)
plt.title(title)
开发者ID:VirgileFritsch,项目名称:nilearn,代码行数:7,代码来源:plot_mask_computation.py
注:本文中的numpy.rot90函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论