Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gllssi2isis Original Label Fix #3226

Merged
merged 13 commits into from
Apr 16, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 8 additions & 29 deletions isis/src/base/objs/ProcessImport/ProcessImport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1199,27 +1199,21 @@ namespace Isis {
}
}


/**
* Create the output file. This method will use the cube attribute object
* passed in to populate the pixel type and pass the desired samples, lines,
* and band numbers into the process setOutputCube method.
* Create the output file. Note that all the appropiate calls to at least
* SetDimensions and SetPixelType should be made prior to calling this method.
*
* @param parameter The parameter name that holds the output file name.
*
* @param ns The number of samples in the output cube
*
* @param nl The number of lines in the output cube
*
* @param nb The number of bands in the output cube
*
* @return @b Isis::Cube Output cube.
*
* @throws Isis::iException::Message "Unsupported pixel type."
*/
Isis::Cube *ProcessImport::SetOutputCube(const QString &parameter, const int ns, const int nl, const int nb) {
FileName fname = Application::GetUserInterface().GetFileName(parameter);
CubeAttributeOutput att =
Isis::Cube *ProcessImport::SetOutputCube(const QString &parameter) {
CubeAttributeOutput &att =
Application::GetUserInterface().GetOutputAttribute(parameter);

if (att.propagateMinimumMaximum()) {
double min, max;
if ((p_pixelType == Isis::Double) ||
Expand Down Expand Up @@ -1270,20 +1264,7 @@ namespace Isis {
}
}

return Process::SetOutputCube(fname.expanded(), att, ns, nl, nb);
}


/**
* Create the output file. Note that all the appropiate calls to at least
* SetDimensions and SetPixelType should be made prior to calling this method.
*
* @param parameter The parameter name that holds the output file name.
*
* @return @b Isis::Cube Output cube.
*/
Isis::Cube *ProcessImport::SetOutputCube(const QString &parameter) {
return ProcessImport::SetOutputCube(parameter, p_ns, p_nl, p_nb);
return Process::SetOutputCube(Application::GetUserInterface().GetFileName(parameter), att, p_ns, p_nl, p_nb);
}


Expand All @@ -1297,7 +1278,6 @@ namespace Isis {
* output cube.
*
* @return @b Isis::Cube Output cube.
*
* @throws Isis::iException::Message "File is not in a supported
* organization."
*/
Expand Down Expand Up @@ -1335,7 +1315,6 @@ namespace Isis {
* @param funct Method that accepts Isis::Buffer as an input
* parameter, processes the image, and has no
* return value.
*
* @throws Isis::iException::Message "File is not a supported
* organization."
*/
Expand Down Expand Up @@ -1998,7 +1977,7 @@ namespace Isis {
break;
case Isis::SignedInteger:
(*out)[samp] = (double)swapper.Int(&in[bufferIndex]);
break;
break;
case Isis::UnsignedInteger:
(*out)[samp] = (double)swapper.Uint32_t(&in[bufferIndex]);
break;
Expand Down
7 changes: 2 additions & 5 deletions isis/src/base/objs/ProcessImport/ProcessImport.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,9 @@ namespace Isis {
* was made to accomodate Rosetta VIRTIS-m calibrated data files and
* has no impact on other supported BIP files.
* Fixes #5398.
* @history 2018-07-19 Tyler Wilson - Added support for 4-byte UnsignedInteger special pixel
* @history 208-07-19 Tyler Wilson - Added support for 4-byte UnsignedInteger special pixel
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was removed due to me clobbering the changes I had made to the ProcessImport files. WIll re-add

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

* values.
* @history 2019-04-15 Adam Paquette - Exposed the ns, nl, nb (number of samples, lines, and bands)
* for the setOutputCube function. Updated existing setOutputCube methods
* accordingly.
*
*/
class ProcessImport : public Isis::Process {
public:
Expand Down Expand Up @@ -201,7 +199,6 @@ namespace Isis {

using Isis::Process::SetOutputCube; // make parent functions visable
Isis::Cube *SetOutputCube(const QString &parameter);
Isis::Cube *SetOutputCube(const QString &parameter, const int ns, const int nl, const int nb);
virtual Isis::Cube *SetOutputCube(const QString &fname,
Isis::CubeAttributeOutput &att);

Expand Down
4 changes: 2 additions & 2 deletions isis/src/galileo/apps/gllssi2isis/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ void IsisMain() {
p.StartProcess();
}
else {
// CubeAttributeOutput att = ui.GetOutputAttribute("TO");
summedOutput = p.SetOutputCube("TO", p.Samples() / 2, p.Lines() / 2, p.Bands());
p.SetDimensions(p.Samples() / 2, p.Lines() / 2, p.Bands());
summedOutput = p.SetOutputCube("TO");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ocube = p.SetOutputCube("TO"); ?

Do we need summedOutput now...?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that summedOutput is being used further down. Is that why we still need to instantiate it here?

ocube = summedOutput;
p.StartProcess(translateData);
}
Expand Down