diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-08-22 21:07:48 (GMT) |
---|---|---|
committer | William Joye <wjoye@cfa.harvard.edu> | 2018-08-22 21:07:48 (GMT) |
commit | 8ecc2d9c3457817c34c9b3a759b8c1e0c6bcf94e (patch) | |
tree | 52d74fb53c48c0dd9428979f412a2c37ebe2f667 /tksao | |
parent | 14d994eb1a2a5a46d69afe10b818355938576603 (diff) | |
download | blt-8ecc2d9c3457817c34c9b3a759b8c1e0c6bcf94e.zip blt-8ecc2d9c3457817c34c9b3a759b8c1e0c6bcf94e.tar.gz blt-8ecc2d9c3457817c34c9b3a759b8c1e0c6bcf94e.tar.bz2 |
fix problem with binned layers in RGB image
Diffstat (limited to 'tksao')
-rw-r--r-- | tksao/frame/basecommand.C | 95 | ||||
-rw-r--r-- | tksao/frame/fr3dcommand.C | 6 | ||||
-rw-r--r-- | tksao/frame/frcommand.C | 6 |
3 files changed, 73 insertions, 34 deletions
diff --git a/tksao/frame/basecommand.C b/tksao/frame/basecommand.C index 0113e9d..807fac6 100644 --- a/tksao/frame/basecommand.C +++ b/tksao/frame/basecommand.C @@ -63,8 +63,11 @@ void Base::binCmd(const Vector& b, const Vector& vv, currentContext->fits->setBinY(y); currentContext->fits->setBinFilter(filter); } - Matrix mm = currentContext->bin(vv); - updateBin(mm); + + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->bin(vv); + updateBin(mm); + } } void Base::binCmd(const Vector& b, const char* x, const char* y, @@ -77,8 +80,11 @@ void Base::binCmd(const Vector& b, const char* x, const char* y, currentContext->fits->setBinY(y); currentContext->fits->setBinFilter(filter); } - Matrix mm = currentContext->binCenter(); - updateBin(mm); + + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCenter(); + updateBin(mm); + } } void Base::binCmd(const Vector& b, int d, const Vector& lim, @@ -95,8 +101,11 @@ void Base::binCmd(const Vector& b, int d, const Vector& lim, currentContext->fits->setBinFilter(filter); currentContext->fits->setBinColMinMax(z,lim); } - Matrix mm = currentContext->bin(vv); - updateBin(mm); + + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->bin(vv); + updateBin(mm); + } } void Base::binCmd(const Vector& b, int d, const Vector& lim, @@ -112,27 +121,36 @@ void Base::binCmd(const Vector& b, int d, const Vector& lim, currentContext->fits->setBinFilter(filter); currentContext->fits->setBinColMinMax(z,lim); } - Matrix mm = currentContext->binCenter(); - updateBin(mm); + + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCenter(); + updateBin(mm); + } } void Base::binAboutCmd() { - Matrix mm = currentContext->binCenter(); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCenter(); + updateBin(mm); + } } void Base::binAboutCmd(const Vector& vv) { - Matrix mm = currentContext->bin(vv); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->bin(vv); + updateBin(mm); + } } void Base::binBufferSizeCmd(int size) { currentContext->setBinBufferSize(size); - Matrix mm = currentContext->binCursor(); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCursor(); + updateBin(mm); + } } void Base::binColsCmd(const char* x, const char* y, const char* z) @@ -142,58 +160,75 @@ void Base::binColsCmd(const char* x, const char* y, const char* z) currentContext->fits->setBinY(y); currentContext->fits->setBinZ(z); } - Matrix mm = currentContext->binCursor(); - updateBin(mm); + + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCursor(); + updateBin(mm); + } } void Base::binDepthCmd(int d) { currentContext->setBinDepth(d); - Matrix mm = currentContext->binCursor(); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCursor(); + updateBin(mm); + } } void Base::binFactorCmd(const Vector& bb) { currentContext->setBinFactor(bb); - Matrix mm = currentContext->binCursor(); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCursor(); + updateBin(mm); + } } void Base::binFactorAboutCmd(const Vector& bb, const Vector& vv) { currentContext->setBinFactor(bb); - Matrix mm = currentContext->bin(vv); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->bin(vv); + updateBin(mm); + } } void Base::binFactorToCmd(const Vector& bb) { currentContext->setBinToFactor(bb); - Matrix mm = currentContext->binCursor(); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCursor(); + updateBin(mm); + } } void Base::binFactorToAboutCmd(const Vector& bb, const Vector& vv) { currentContext->setBinToFactor(bb); - Matrix mm = currentContext->bin(vv); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->bin(vv); + updateBin(mm); + } } void Base::binFunctionCmd(FitsHist::Function func) { currentContext->setBinFunction(func); - Matrix mm = currentContext->binCursor(); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCursor(); + updateBin(mm); + } } void Base::binFilterCmd(const char* filter) { if (currentContext->fits) currentContext->fits->setBinFilter(filter); - Matrix mm = currentContext->binCursor(); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCursor(); + updateBin(mm); + } } void Base::blockCmd(const Vector& bb) diff --git a/tksao/frame/fr3dcommand.C b/tksao/frame/fr3dcommand.C index f864649..27e4380 100644 --- a/tksao/frame/fr3dcommand.C +++ b/tksao/frame/fr3dcommand.C @@ -25,8 +25,10 @@ void Frame3dBase::binToFitCmd() keyContext->setBinToFactor(Vector(p,p)); } - Matrix mm = keyContext->binCursor(); - updateBin(mm); + if (keyContext->fits && keyContext->fits->isHist()) { + Matrix mm = keyContext->binCursor(); + updateBin(mm); + } } void Frame3dBase::blockToFitCmd() diff --git a/tksao/frame/frcommand.C b/tksao/frame/frcommand.C index b466444..2f2c306 100644 --- a/tksao/frame/frcommand.C +++ b/tksao/frame/frcommand.C @@ -32,8 +32,10 @@ void FrameBase::binToFitCmd() } } - Matrix mm = currentContext->binCursor(); - updateBin(mm); + if (currentContext->fits && currentContext->fits->isHist()) { + Matrix mm = currentContext->binCursor(); + updateBin(mm); + } } void FrameBase::blockToFitCmd() |