def imageData1DYChanging(sb):
    global current_image_data1, rotation, dx, dy
    dy = sb.value()
    current_image_data1 = affine.affine(image_data1,
                                        magnification=magnification,
                                        rotation=np.deg2rad(rotation),
                                        tx=dx,
                                        ty=dy,
                                        hf=horizontal_flip,
                                        vf=vertical_flip)
    ii_image_data1.setImage(current_image_data1)
    imageData1_imageData2RandomPlot()
def imageData1dyChanged(sb):
    global current_image_data1, rotation, dx, dy
    dy = sb.value()
    current_image_data1 = affine.affine(image_data1,
                                        magnification=magnification,
                                        rotation=np.deg2rad(rotation),
                                        tx=dx,
                                        ty=dy,
                                        hf=horizontal_flip,
                                        vf=vertical_flip)
    ii_image_data1.setImage(current_image_data1)
    imageData1_imageData2RandomPlot()
    imageData1MaxChanged(imageData1MaxSpinBox)
    imageData1MinChanged(imageData1MinSpinBox)
    imageData1AlphaChanged(imageData1AplhaSpinBox)
    imageData2AlphaChanged(imageData2AplhaSpinBox)
win = QtGui.QMainWindow()
win.setWindowTitle('Combinatorial -image analysys')
cw = QtGui.QWidget()
layout = QtGui.QGridLayout()
cw.setLayout(layout)
win.setCentralWidget(cw)
win.show()
win.resize(1200, 700)

# データ読み込み、画像表示
vb = pg.ViewBox(invertY=True)
image_data1 = np.loadtxt('./data/bp.dat')
current_image_data1 = affine.affine(image_data1,
                                    magnification=magnification,
                                    rotation=rotation,
                                    tx=dx,
                                    ty=dx)

image_data2 = np.loadtxt('./data/theta.dat')
ii_image_data2 = pg.ImageItem(image_data2, opacity=0.5, levels=(-0.3, 0.3))
vb.addItem(ii_image_data2)
ii_image_data1 = pg.ImageItem(current_image_data1, opacity=0.5)
vb.addItem(ii_image_data1)

vb.autoRange()
vb.setAspectLocked(True)
imgpw = pg.PlotWidget()
imgpw.addItem(vb)
layout.addWidget(imgpw, 0, 0, layout_image_step, layout_image_step)