Possibility to open the failed (not completed) scans#1208
Possibility to open the failed (not completed) scans#1208sergey-yaroslavtsev merged 3 commits intomasterfrom
Conversation
| padded[:old_length] = flat | ||
| self._imageDict[key]["image"] = padded | ||
| self.__prePadLength = old_length | ||
| self.__imageLength = new_length |
There was a problem hiding this comment.
If I'm not mistaken this function gets called whenever the user changes the number of rows or columns in the pop-up dialog right? Since we replace the images in-place, how can that work?
There was a problem hiding this comment.
Sorry I was not clear. This part is for 'reshape' in RGBCorrelator, when image is open and user click "reshape".
This reshape dialog which was modified appears in two scenarios:
- through
QStackWidget(on call of ROIImaging tool) - 'reshape' button in RGBCorrelator.
I thought that it is easier to add padding also to RGBCorrelator (do not know if anyone need it) rather then create a new dialog or making it flexible.
If you find it confusing and useless this dialog can be separate to two different and then padding for RGBCorrelator can be removed.
There was a problem hiding this comment.
There was a problem hiding this comment.
Ok I need lots of time to understand all this.
Is the "reshape" button the the RGB correlator new? What does it do? Same for "Image size" and "300 x 300".
I cannot even open the RGB correlator without any data just the see the widget.
There was a problem hiding this comment.
Is the "reshape" button the the RGB correlator new? What does it do? Same for "Image size" and "300 x 300".
It is not new. It reshape the array to represent it. For example you can open 1D dataset of 25 and the click reshape and make it look 5x5. "image size" just shows you the current status of shape (rows and columns).
I cannot even open the RGB correlator without any data just the see the widget.
It is strange - if you open RGBCorrelator and then close the file chooser, the widget appears with no data:

There was a problem hiding this comment.
But you cannot open ROI tool without data, it is true.
Crop is forbidden to avoid confusion from user side (if they wrongly pad) - so the data could not be "deleted" only "added". |
| msg = qt.QMessageBox(self) | ||
| msg.setIcon(qt.QMessageBox.Critical) | ||
| msg.setText( | ||
| "Shape %d x %d = %d is smaller than data size %d.\n\n" |
There was a problem hiding this comment.
This is for "reshape" in the RGB correlator right? So we need something like this for ROI imaging as well.
There was a problem hiding this comment.
QStackWidget use dialog from RGBCorrelatorWidget. Then this dialog pass shape (entered by user) to the widget.
This message is on dialog side (on accept) - no matter in what widget it happens.
Padding is happening on widget side - we need two padding mechanisms.
There was a problem hiding this comment.
i've tested it works in both as intended. there was a typo - i fixed it.
update: i mean the error message appears in both case when dialog is called from RGBCorrelator and from ROItool




Closes #1175
In the reshape menu a new checkbox was added - to specify that scan is not complete. Then both rows and columns could be set manually (without adjustment to the array size). Array will be pad with
nan.This is a most user-friendly approach from my perspective.
drawbacks:
nanis recognized only infloat, whileshow as 1D stack(not the RGBCorrelator by the way, which doimage = numpy.array(image0).astype(numpy.float64)) option was able to keep the originaldtype(saving memory sometimes) now if user want to pad, it need to be changed intofloatanyway. I do not see anything else to be used instead ofnanwithout making confusions or adding issues.info(_padStackInfoArraysinQStackWidget) to be able to use other functionality - not a big deal but could be considered as an ugly solution... for exampleStackBaseMcaAdvancedFitBatchuse this info and/or positioners including their shape/size.positionerscould be pad withnan, other things liketimei pad with zeros.If the checkbox is not ticked the logic should remain as it was before - so new code could break only new feature itself.