def init_ui(self): FslWidget.init_ui(self) data = self.options.add("Input data", DataOption(self.ivm), key="data") data.sig_changed.connect(self._data_changed) self.options.add("Output extracted brain image", OutputNameOption(src_data=data, suffix="_brain"), key="output-brain", checked=True, enabled=True) self.options.add("Output brain mask", OutputNameOption(src_data=data, suffix="_brain_mask"), key="output-mask", checked=True) self.options.add("Intensity threshold", NumericOption(minval=0, maxval=1, default=0.5), key="thresh") self.options.add("Head radius (mm)", NumericOption(intonly=True, minval=0, maxval=300, default=200), key="radius", checked=True) self.centre = self.options.add("Brain centre (raw co-ordinates)", PickPointOption(self.ivl), key="centre", checked=True)
def init_ui(self): layout = QtGui.QVBoxLayout() self.setLayout(layout) title = TitleWidget(self, help="reg") layout.addWidget(title) if not self.reg_methods: layout.addWidget(QtGui.QLabel("No registration methods found")) layout.addStretch(1) return self.options = OptionBox("General Options") self.options.add("Transform", TransformOption(self.ivm), key="transform") self.options.add("Apply to data", DataOption(self.ivm), key="data") self.options.add("Interpolation", ChoiceOption(["Nearest neighbour", "Linear", "Spline"], [0, 1, 3], default=1), key="interp-order") self.options.add("Output name", OutputNameOption(src_data=self.options.option("data"), suffix="_reg"), key="output-name") self.options.option("transform").sig_changed.connect(self._transform_changed) layout.addWidget(self.options) self.details = TransformDetails() layout.addWidget(self.details) layout.addWidget(RunButton(self)) layout.addStretch(1) self._transform_changed()
def init_ui(self): layout = QtGui.QVBoxLayout() self.setLayout(layout) title = TitleWidget(self, help="simple_maths") layout.addWidget(title) info = QtGui.QLabel(MATHS_INFO) info.setWordWrap(True) layout.addWidget(info) self.optbox = OptionBox() self.optbox.add("Data space from", DataOption(self.ivm), key="grid") self.optbox.add("Command", TextOption(), key="cmd") self.optbox.add("Output name", OutputNameOption(src_data=self.optbox.option("grid")), key="output-name") self.optbox.add("Output is an ROI", BoolOption(), key="output-is-roi") layout.addWidget(self.optbox) hbox = QtGui.QHBoxLayout() self.go_btn = RunButton(self) hbox.addWidget(self.go_btn) hbox.addStretch(1) layout.addLayout(hbox) layout.addStretch(1)
def init_ui(self): layout = QtGui.QVBoxLayout() self.setLayout(layout) title = TitleWidget(self, title="Registration and Motion Correction", help="reg") layout.addWidget(title) if not self.reg_methods: layout.addWidget(QtGui.QLabel("No registration methods found")) layout.addStretch(1) return self.options = OptionBox("General Options") self.options.add("Mode", ChoiceOption(["Registration", "Motion Correction"], ["reg", "moco"]), key="mode") self.options.add("Method", ChoiceOption([method.display_name for method in self.reg_methods], self.reg_methods), key="method") self.options.add("Registration data", DataOption(self.ivm), key="reg") self.options.add("Reference data", DataOption(self.ivm), key="ref") self.options.add("Reference volume", ChoiceOption(["Middle volume", "Mean volume", "Specified volume"], ["median", "mean", "idx"]), key="ref-vol") self.options.add("Reference volume index", NumericOption(intonly=True), key="ref-idx") self.options.add("Output space", ChoiceOption(["Reference", "Registration", "Transformed"], ["ref", "reg", "trans"]), key="output-space") self.options.add("Output name", OutputNameOption(src_data=self.options.option("reg"), suffix="_reg"), key="output-name", checked=True) self.options.add("Also apply transform to", DataOption(self.ivm, multi=True), key="add-reg") self.options.add("Save transformation", TextOption(), key="save-transform", checked=True, default=False) self.options.option("mode").sig_changed.connect(self._update_option_visibility) self.options.option("method").sig_changed.connect(self._method_changed) self.options.option("ref").sig_changed.connect(self._update_option_visibility) self.options.option("ref-vol").sig_changed.connect(self._update_option_visibility) self.options.option("reg").sig_changed.connect(self._update_option_visibility) layout.addWidget(self.options) # Create the options boxes for reg methods - only one visible at a time! self.opt_boxes = {} for method in self.reg_methods: hbox = QtGui.QHBoxLayout() opt_box = QtGui.QGroupBox() opt_box.setTitle(method.display_name) vbox = QtGui.QVBoxLayout() opt_box.setLayout(vbox) vbox.addWidget(method.interface()) hbox.addWidget(opt_box) opt_box.setVisible(False) layout.addLayout(hbox) self.opt_boxes[method.name] = opt_box layout.addWidget(RunWidget(self)) layout.addStretch(1) self._method_changed()
def init_ui(self): vbox = QtGui.QVBoxLayout() self.setLayout(vbox) title = TitleWidget( self, title="PCA reduction", subtitle="Principal Component Analysis for 4D data") vbox.addWidget(title) self._options = OptionBox("Options") self._options.add("Data", DataOption(self.ivm, include_3d=False), key="data") self._options.add("ROI", DataOption(self.ivm, data=False, rois=True), key="roi") self._options.add("Number of components", NumericOption(minval=1, intonly=True, default=4), key="n-components") self._options.add("Output name", OutputNameOption( src_data=self._options.option("data"), suffix="_pca"), key="output-name") self._options.option("data").sig_changed.connect(self._data_changed) vbox.addWidget(self._options) self._run = RunWidget(self) self._run.sig_postrun.connect(self._postrun) vbox.addWidget(self._run) self.plot = Plot(qpo=None, parent=self, title="PCA modes") self.variance_model = QtGui.QStandardItemModel() variance_table = QtGui.QTableView() variance_table.verticalHeader().hide() variance_table.setModel(self.variance_model) tabs = QtGui.QTabWidget() tabs.addTab(self.plot, "PCA modes") tabs.addTab(variance_table, "Explained variance") tabs.setCurrentWidget(self.plot) vbox.addWidget(tabs) vbox.addStretch(1) self._data_changed()
def init_ui(self): vbox = QtGui.QVBoxLayout() self.setLayout(vbox) title = TitleWidget(self, title="Simulate Motion", help="sim_motion") vbox.addWidget(title) self.option_box = OptionBox("Options") data = self.option_box.add("Data set", DataOption(self.ivm, include_4d=True, include_3d=False), key="data") self.option_box.add("Random translation standard deviation (mm)", NumericOption(minval=0, maxval=5, default=1, decimals=2), key="std") self.option_box.add( "Random rotation standard deviation (\N{DEGREE SIGN})", NumericOption(minval=0, maxval=10, default=1, decimals=2), key="std_rot") self.option_box.add("Padding (mm)", NumericOption(minval=0, maxval=10, default=5, decimals=1), key="padding", checked=True) self.option_box.add( "Interpolation", ChoiceOption(["Nearest neighbour", "Linear", "Quadratic", "Cubic"], return_values=range(4), default=3), key="order") self.option_box.add("Output name", OutputNameOption(src_data=data, suffix="_moving"), key="output-name") vbox.addWidget(self.option_box) run_btn = QtGui.QPushButton('Run', self) run_btn.clicked.connect(self.run) vbox.addWidget(run_btn) vbox.addStretch(1)
def init_ui(self): vbox = QtGui.QVBoxLayout() self.setLayout(vbox) vbox.addWidget(TitleWidget(self)) self.optbox = OptionBox("Resampling options") self.data = self.optbox.add("Data to resample", DataOption(self.ivm), key="data") self.resample_type = self.optbox.add( "Resampling method", ChoiceOption( ["On to grid from another data set", "Upsample", "Downsample"], ["data", "up", "down"]), key="type") self.grid_data = self.optbox.add("Use grid from", DataOption(self.ivm), key="grid") self.factor = self.optbox.add("Factor", NumericOption(default=2, minval=2, maxval=10, intonly=True), key="factor") self.slicewise = self.optbox.add("2D only", BoolOption(), key="2d") self.order = self.optbox.add( "Interpolation", ChoiceOption(["Nearest neighbour", "Linear", "Quadratic", "Cubic"], [0, 1, 2, 3], default=1), key="order") self.output_name = self.optbox.add("Output name", OutputNameOption(src_data=self.data, suffix="_res"), key="output-name") vbox.addWidget(self.optbox) self.resample_type.sig_changed.connect(self._resample_type_changed) self.run = RunButton("Resample", self._run) vbox.addWidget(self.run) vbox.addStretch(1) self._resample_type_changed()
def init_ui(self): FabberWidget.init_ui(self) self.param_values_box = OptionBox("Parameter values") self.param_values_box.sig_changed.connect(self._param_values_changed) self.vbox.addWidget(self.param_values_box) run_btn = QtGui.QPushButton('Generate test data', self) run_btn.clicked.connect(self._run) self.vbox.addWidget(run_btn) self.vbox.addStretch(1) model_opts_btn = QtGui.QPushButton('Model Options') model_opts_btn.clicked.connect(self._show_model_options) self.options.add("Model group", ChoiceOption(), key="model-group") self.options.add("Model", ChoiceOption(), model_opts_btn, key="model") self.options.add("Number of volumes (time points)", NumericOption(intonly=True, minval=1, maxval=100, default=10), key="num-vols") self.options.add("Voxels per patch (approx)", NumericOption(intonly=True, minval=1, maxval=10000, default=1000), key="num-voxels") self.options.add("Noise (Gaussian std.dev)", NumericOption(intonly=True, minval=0, maxval=1000, default=0), key="noise") self.options.add("Output data name", OutputNameOption(initial="fabber_test_data"), key="output-name") self.options.add("Output noise-free data", BoolOption(), key="save-clean") self.options.add("Output parameter ROIs", BoolOption(), key="save-rois") self.options.option("model-group").sig_changed.connect(self._model_group_changed) model_groups = ["ALL"] for group in FabberProcess.api().get_model_groups(): model_groups.append(group.upper()) self.options.option("model-group").setChoices(model_groups) self.options.option("model-group").value = "ALL" self._model_group_changed() self.options.option("model").value = "poly" self._options_changed() # Start with something sensible for the polynomial model self._param_test_values = {"c0" : [-100, 0, 100], "c1" : [-10, 0, 10], "c2" : [-1, 0, 1]} self._update_params()
def init_ui(self): vbox = QtGui.QVBoxLayout() self.setLayout(vbox) vbox.addWidget(TitleWidget(self)) optbox = OptionBox("Resampling options") self.data = optbox.add("Data to resample", DataOption(self.ivm)) self.grid_data = optbox.add("Resample onto grid from", DataOption(self.ivm)) self.order = optbox.add( "Interpolation", ChoiceOption(["Nearest neighbour", "Linear", "Quadratic", "Cubic"], [0, 1, 2, 3])) self.output_name = optbox.add( "Output name", OutputNameOption(src_data=self.data, suffix="_res")) vbox.addWidget(optbox) self.run = RunButton("Resample", self._run) vbox.addWidget(self.run) vbox.addStretch(1)
def init_ui(self): vbox = QtGui.QVBoxLayout() self.setLayout(vbox) title = TitleWidget(self, title="Add Noise", help="noise") vbox.addWidget(title) self.option_box = OptionBox("Options") data = self.option_box.add("Data set", DataOption(self.ivm), key="data") self.option_box.add("Gaussian standard deviation", NumericOption(minval=0, maxval=100, default=50), key="std") self.option_box.add("Output name", OutputNameOption(src_data=data, suffix="_noisy"), key="output-name") vbox.addWidget(self.option_box) run_btn = QtGui.QPushButton('Run', self) run_btn.clicked.connect(self.run) vbox.addWidget(run_btn) vbox.addStretch(1)
def init_ui(self): vbox = QtGui.QVBoxLayout() self.setLayout(vbox) title = TitleWidget(self, title="Simulate Motion", help="sim_motion") vbox.addWidget(title) self.option_box = OptionBox("Options") data = self.option_box.add("Data set", DataOption(self.ivm, include_4d=True, include_3d=False), key="data") self.option_box.add("Motion standard deviation (mm)", NumericOption(minval=0, maxval=5, default=1, decimals=2), key="std") self.option_box.add("Padding (mm)", NumericOption(minval=0, maxval=10, default=5, decimals=1), key="padding", checked=True) self.option_box.add("Output name", OutputNameOption(src_data=data, suffix="_moving"), key="output-name") vbox.addWidget(self.option_box) run_btn = QtGui.QPushButton('Run', self) run_btn.clicked.connect(self.run) vbox.addWidget(run_btn) vbox.addStretch(1)