Skip to content

Commit 6a2991f

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 48836df + 12c0706 commit 6a2991f

File tree

3 files changed

+69
-8
lines changed

3 files changed

+69
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ https://github.com/SCIInstitute/SCIRun
1919

2020
### Summary
2121

22-
| Warning! | SCIRun 5 is alpha software, you may use for real science but beware of instability. |
22+
| Warning! | SCIRun 5 is beta software, you may use for real science but beware of instability. |
2323
|:--------:|:-------------------------------------------------------------------------------------:|
2424

2525
### Goals

src/Core/Python/Tests/PythonInterpreterTests.cc

Lines changed: 60 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ class FieldConversionTests : public testing::Test
133133
return loadFieldFromFile(TestResources::rootDir() / "Fields/test_image_node.fld");
134134
}
135135

136-
//static FieldHandle CreatePointCloudScalar()
137-
//{
138-
// return loadFieldFromFile(TestResources::rootDir() / "Fields/point_cloud/scalar/pts_scalar.fld");
139-
//}
136+
static FieldHandle CreateTriSurfFromCVRTI()
137+
{
138+
return loadFieldFromFile(TestResources::rootDir() / "Fields/CVRTI_cappedTorso/CappedTorso_192.fld");
139+
}
140140

141141
static std::vector<FieldHandle> fileExamples()
142142
{
@@ -332,6 +332,62 @@ TEST_F(FieldConversionTests, RoundTripTetVolNode)
332332
EXPECT_EQ("GenericField<TetVolMesh<TetLinearLgn<Point>>,TetLinearLgn<double>,vector<double>>", info.get_field_type_id());
333333
}
334334

335+
// TODO: found a workaround for Brett's failing mesh (need to set data to all zeros)
336+
TEST_F(FieldConversionTests, DISABLED_RoundTripTriSurfCVRTI)
337+
{
338+
auto expected = CreateTriSurfFromCVRTI();
339+
{
340+
FieldInformation info(expected);
341+
EXPECT_TRUE(info.is_trisurf());
342+
EXPECT_TRUE(info.is_double());
343+
EXPECT_TRUE(info.is_scalar());
344+
EXPECT_TRUE(info.is_linear());
345+
EXPECT_EQ("TriSurfMesh<TriLinearLgn<Point>>", info.get_mesh_type_id());
346+
EXPECT_EQ("TriSurfMesh", info.get_mesh_type());
347+
EXPECT_EQ("GenericField<TriSurfMesh<TriLinearLgn<Point>>,TriLinearLgn<double>,vector<double>>", info.get_field_type_id());
348+
}
349+
350+
auto pyField = convertFieldToPython(expected);
351+
EXPECT_EQ(10, len(pyField.items()));
352+
{
353+
boost::python::extract<boost::python::dict> e(pyField);
354+
auto pyMatlabDict = e();
355+
356+
auto length = len(pyMatlabDict);
357+
358+
auto keys = pyMatlabDict.keys();
359+
auto values = pyMatlabDict.values();
360+
361+
for (int i = 0; i < length; ++i)
362+
{
363+
boost::python::extract<std::string> key_i(keys[i]);
364+
365+
boost::python::extract<std::string> value_i_string(values[i]);
366+
boost::python::extract<boost::python::list> value_i_list(values[i]);
367+
auto fieldName = key_i();
368+
std::cout << "setting field " << fieldName << " " << (value_i_string.check() ? value_i_string() : "NOT A STRING") << std::endl;
369+
}
370+
}
371+
372+
FieldExtractor converter(pyField);
373+
374+
ASSERT_TRUE(converter.check());
375+
376+
auto actual = converter();
377+
ASSERT_TRUE(actual != nullptr);
378+
auto actualField = boost::dynamic_pointer_cast<Field>(actual);
379+
ASSERT_TRUE(actualField != nullptr);
380+
381+
FieldInformation info(actualField);
382+
EXPECT_TRUE(info.is_trisurf());
383+
EXPECT_TRUE(info.is_double());
384+
EXPECT_TRUE(info.is_scalar());
385+
EXPECT_TRUE(info.is_linear());
386+
EXPECT_EQ("TriSurfMesh<TriLinearLgn<Point>>", info.get_mesh_type_id());
387+
EXPECT_EQ("TriSurfMesh", info.get_mesh_type());
388+
EXPECT_EQ("GenericField<TriSurfMesh<TriLinearLgn<Point>>,TriLinearLgn<double>,vector<double>>", info.get_field_type_id());
389+
}
390+
335391
TEST_F(FieldConversionTests, RoundTripTetVolCell)
336392
{
337393
auto expected = CreateTetMeshScalarOnElem();

src/Interface/Application/SCIRunMainWindow.cc

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -326,8 +326,8 @@ SCIRunMainWindow::SCIRunMainWindow() : shortcuts_(nullptr), returnCode_(0), quit
326326
//TODO: store in xml file, add to app resources
327327
connect(actionForwardInverse_, SIGNAL(triggered()), this, SLOT(toolkitDownload()));
328328
actionForwardInverse_->setProperty(ToolkitIconURL, QString("http://www.sci.utah.edu/images/software/forward-inverse/forward-inverse-mod.png"));
329-
actionForwardInverse_->setProperty(ToolkitURL, QString("http://sci.utah.edu/devbuilds/scirun5/toolkits/FwdInvToolkit_v1.zip"));
330-
actionForwardInverse_->setProperty(ToolkitFilename, QString("FwdInvToolkit_v1.zip"));
329+
actionForwardInverse_->setProperty(ToolkitURL, QString("http://sci.utah.edu/devbuilds/scirun5/toolkits/FwdInvToolkit_v1.2.zip"));
330+
actionForwardInverse_->setProperty(ToolkitFilename, QString("FwdInvToolkit_v1.2.zip"));
331331
actionForwardInverse_->setIcon(QPixmap(":/general/Resources/download.png"));
332332

333333
connect(actionBrainStimulator_, SIGNAL(triggered()), this, SLOT(toolkitDownload()));
@@ -1940,7 +1940,11 @@ void FileDownloader::fileDownloaded(QNetworkReply* reply)
19401940
void FileDownloader::downloadProgress(qint64 received, qint64 total)
19411941
{
19421942
if (statusBar_)
1943+
{
19431944
statusBar_->showMessage(tr("File progress: %1 / %2").arg(received).arg(total), 1000);
1945+
if (received == total)
1946+
statusBar_->showMessage("File downloaded.", 1000);
1947+
}
19441948
}
19451949

19461950
void SCIRunMainWindow::toolkitDownload()
@@ -1983,7 +1987,7 @@ void ToolkitDownloader::showMessageBox()
19831987
#else
19841988
toolkitInfo.setText("Toolkit information");
19851989
#endif
1986-
toolkitInfo.setInformativeText("Click OK to download the latest version of this toolkit.");
1990+
toolkitInfo.setInformativeText("Click OK to download the latest version of this toolkit:\n\n" + fileUrl_);
19871991
toolkitInfo.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
19881992
toolkitInfo.setIconPixmap(image);
19891993
toolkitInfo.setDefaultButton(QMessageBox::Ok);
@@ -2012,4 +2016,5 @@ void ToolkitDownloader::saveToolkit()
20122016
file.open(QIODevice::WriteOnly);
20132017
file.write(zipDownloader_->downloadedData());
20142018
file.close();
2019+
statusBar_->showMessage("Toolkit file saved.", 1000);
20152020
}

0 commit comments

Comments
 (0)