napari-micromanager icon indicating copy to clipboard operation
napari-micromanager copied to clipboard

Set pixel size when equal to 1

Open ianhi opened this issue 4 years ago • 2 comments

This should cause the explorer test to fail - which I will fix in https://github.com/tlambert03/napari-micromanager/pull/134 opened separately because this is relatively simple. Also this fix is needed to get the updated explorer tests to behave properly.

based on #132 to get working tests. Only commit here is: https://github.com/tlambert03/napari-micromanager/commit/1994be80b850ca4d8a150e278e058a2a230af516

ianhi avatar Mar 05 '22 22:03 ianhi

There actually may be more here to get right than I thought - I don't fully understand this pixel size stuff.

But this is no longer causing #134 to fail because I fixed the core instancing over there

ianhi avatar Mar 06 '22 04:03 ianhi

@ianhi

To make the update_pixel_size method in the core working properly I think we need to:

  • modify _camera_widget.py: from: self.px_size_spinbox.setMinimum(1.0) to :
    self.px_size_spinbox.setMinimum(0.0)
    self.px_size_spinbox.setValue(0.0)
    
  • update test_objective_device_and_px_size:
    def test_objective_device_and_px_size(main_window: MainWindow):
        mmc = main_window._mmc
    
        main_window.obj_wdg.objective_comboBox.setCurrentText("10X")
        assert main_window.obj_wdg.objective_comboBox.currentText() == "10X"
        assert mmc.getCurrentPixelSizeConfig() == "Res10x"
        assert mmc.getPixelSizeUm() == 1.0
        assert main_window.cam_wdg.px_size_spinbox.value() == 0.0
    
        main_window.obj_wdg.objective_comboBox.setCurrentText("20X")
        assert mmc.getCurrentPixelSizeConfig() == "Res20x"
        assert main_window.cam_wdg.px_size_spinbox.value() == 0.0
    
        main_window.cam_wdg.px_size_spinbox.setValue(6.5)
        assert mmc.getCurrentPixelSizeConfig() == "px_size_Nikon 20X Plan Fluor ELWD"
        assert mmc.getPixelSizeUm() == 0.325
    
        main_window.cam_wdg.px_size_spinbox.setValue(0)
        assert mmc.getPixelSizeUm() == 0.325
    
        mmc.deleteConfigGroup("Objective")
        main_window._refresh_objective_options()
        assert main_window.obj_wdg.objective_comboBox.currentText() == "Nikon 20X Plan Fluor ELWD"
    
        main_window.obj_wdg.objective_comboBox.setCurrentText("Nikon 10X S Fluor")
        assert mmc.getCurrentPixelSizeConfig() == "Res10x"
        assert mmc.getPixelSizeUm() == 1.0
    

fdrgsp avatar Mar 06 '22 16:03 fdrgsp

@fdrgsp @ianhi ... can you guys let me know if the thing this PR was addressing is still a problem?

tlambert03 avatar Dec 06 '22 13:12 tlambert03

let me know if this is still relevant. I'm sorry it sat so long and can help to get it in, but need an update on the need

tlambert03 avatar Dec 06 '22 13:12 tlambert03

ping @ianhi ... would love to clean up these remaining three PRs. so let me know if they're still "todo" worthy, review-worthy, or can be cosed

tlambert03 avatar Jan 20 '23 00:01 tlambert03

I think this one is no longer necessary happily. will check the others

ianhi avatar Jan 20 '23 16:01 ianhi