def checkWindows(self): '''Ensure that the window sizes are valid for the code to work.''' if (self.windowSizeWidth % 2 == 1): raise ValueError('Window size width needs to be multiple of 2.') if (self.windowSizeHeight % 2 == 1): raise ValueError('Window size height needs to be multiple of 2.') if not is_power2(self.zoomWindowSize): raise ValueError('Zoom window size needs to be a power of 2.') if not is_power2(self.oversamplingFactor): raise ValueError('Oversampling factor needs to be a power of 2.') if self.searchWindowSizeWidth >= 2 * self.windowSizeWidth: raise ValueError( 'Search Window Size Width should be < 2 * Window Size Width') if self.searchWindowSizeHeight >= 2 * self.windowSizeHeight: raise ValueError( 'Search Window Size Height should be < 2 * Window Size Height') if self.zoomWindowSize >= min(self.searchWindowSizeWidth, self.searchWindowSizeHeight): raise ValueError( 'Zoom window size should be <= Search window size')
def checkWindows(self): '''Ensure that the window sizes are valid for the code to work.''' if (self.windowSizeWidth%2 == 1): raise ValueError('Window size width needs to be an even number.') if (self.windowSizeHeight%2 == 1): raise ValueError('Window size height needs to be an even number.') if not is_power2(self.zoomWindowSize): raise ValueError('Zoom window size needs to be a power of 2.') if not is_power2(self.oversamplingFactor): raise ValueError('Oversampling factor needs to be a power of 2.') if self.searchWindowSizeWidth >= 2*self.windowSizeWidth : raise ValueError('Search Window Size Width should be < 2 * Window Size Width') if self.searchWindowSizeHeight >= 2*self.windowSizeHeight : raise ValueError('Search Window Size Height should be < 2 * Window Size Height') if self.zoomWindowSize >= min(self.searchWindowSizeWidth, self.searchWindowSizeHeight): raise ValueError('Zoom window size should be <= Search window size') if self._stdWriter is None: self._stdWriter = create_writer("log", "", True, filename="denseampcor.log") self.pixLocOffAc = self.windowSizeWidth//2 + self.searchWindowSizeWidth - 1 self.pixLocOffDn = self.windowSizeHeight//2 + self.searchWindowSizeHeight - 1
def checkWindows(self): '''Ensure that the window sizes are valid for the code to work.''' if (self.windowSizeWidth % 2 == 1): raise ValueError('Window size width needs to be multiple of 2.') if (self.windowSizeHeight % 2 == 1): raise ValueError('Window size height needs to be multiple of 2.') if not is_power2(self.zoomWindowSize): raise ValueError('Zoom window size needs to be a power of 2.') if not is_power2(self.oversamplingFactor): raise ValueError('Oversampling factor needs to be a power of 2.')
def checkWindows(self): ''' Ensure that the window sizes are valid for the code to work. ''' if not is_power2(self.windowSize): raise ValueError('Window size needs to be power of 2.') if not is_power2(self.zoomWindowSize): raise ValueError('Zoom window size needs to be a power of 2.') if not is_power2(self.oversamplingFactor): raise ValueError('Oversampling factor needs to be a power of 2.') if self.searchWindowSize >= (2*self.windowSize): raise ValueError('Search Window Size should be < = 2 * Window Size') if self.zoomWindowSize >= self.searchWindowSize: raise ValueError('Zoom window size should be <= Search window size') return
def setOversamplingFactor(self, var): temp = int(var) if not is_power2(temp): raise ValueError('Oversampling factor needs to be a power of 2.') self.oversamplingFactor = temp
def setZoomWindowSize(self, var): temp = int(var) if not is_power2(temp): raise ValueError('Zoom window size needs to be a power of 2.') self.zoomWindowSize = temp
def setWindowSizeHeight(self, var): temp = int(var) if not is_power2(temp): raise ValueError('Window height needs to be a power of 2.') self.windowSizeHeight = temp return
def setWindowSizeWidth(self, var): temp = int(var) if not is_power2(temp): raise ValueError('Window width needs to be a power of 2.') self.windowSizeWidth = temp return