Skip to content

Commit

Permalink
Merge branch 'development' of https://github.com/CemrgAppDevelopers/C…
Browse files Browse the repository at this point in the history
…emrgApp into development
  • Loading branch information
alonsoJASL committed Mar 11, 2021
2 parents 753dd1e + 0f77804 commit 352da9b
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 22 deletions.
19 changes: 8 additions & 11 deletions Version2.0/Modules/CemrgAppModule/cmdapps/CemrgMorphAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,17 +111,14 @@ int main(int argc, char* argv[]) {

//Import to MITK image
typedef itk::LabelMapToLabelImageFilter<LabelMapType, ImageType> LabelMapToLabelImageFilterType;
LabelMapToLabelImageFilterType::Pointer labelImageConverter1 = LabelMapToLabelImageFilterType::New();
labelImageConverter1->SetInput(selector->GetOutput(1));
labelImageConverter1->Update();
mitk::Image::Pointer bp = mitk::IOUtil::Load<mitk::Image>(directory + "/PVeinsCroppedImage.nii");
LabelMapToLabelImageFilterType::Pointer labelImageConverter2 = LabelMapToLabelImageFilterType::New();
labelImageConverter2->SetInput(selector->GetOutput(0));
labelImageConverter2->Update();
mitk::Image::Pointer ap = mitk::ImportItkImage(labelImageConverter2->GetOutput());

mitk::IOUtil::Save(bp,directory+"/BP.nii.gz");
mitk::IOUtil::Save(ap,directory+"/AP.nii.gz");
LabelMapToLabelImageFilterType::Pointer labelImageConverter = LabelMapToLabelImageFilterType::New();
labelImageConverter->SetInput(selector->GetOutput(0));
labelImageConverter->Update();
mitk::Image::Pointer ap = mitk::ImportItkImage(labelImageConverter->GetOutput());
mitk::Image::Pointer bp = mitk::IOUtil::Load<mitk::Image>(directory + mitk::IOUtil::GetDirectorySeparator() + "PVeinsCroppedImage.nii");

mitk::IOUtil::Save(ap, directory + mitk::IOUtil::GetDirectorySeparator() + "AP.nii.gz");
mitk::IOUtil::Save(bp, directory + mitk::IOUtil::GetDirectorySeparator() + "BP.nii.gz");

//Ask for user input to set the parameters
float th = 0.5;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,10 +500,12 @@ void WallThicknessCalculationsView::MorphologyAnalysis() {

try {

QString path = directory + mitk::IOUtil::GetDirectorySeparator() + "AnalyticBloodpool.nii";
mitk::Image::Pointer analyticImage = mitk::IOUtil::Load<mitk::Image>(path.toStdString());
QString pathAnalytic = directory + mitk::IOUtil::GetDirectorySeparator() + "AnalyticBloodpool.nii";
mitk::Image::Pointer analyticImage = mitk::IOUtil::Load<mitk::Image>(pathAnalytic.toStdString());
QString pathCropped = directory + mitk::IOUtil::GetDirectorySeparator() + "PVeinsCroppedImage.nii";
mitk::Image::Pointer croppedPVImage = mitk::IOUtil::Load<mitk::Image>(pathCropped.toStdString());

if (analyticImage) {
if (analyticImage && croppedPVImage) {

//Loop through labelled image
typedef itk::Image<short, 3> ImageType;
Expand Down Expand Up @@ -541,14 +543,11 @@ void WallThicknessCalculationsView::MorphologyAnalysis() {

//Import to MITK image
typedef itk::LabelMapToLabelImageFilter<LabelMapType, ImageType> LabelMapToLabelImageFilterType;
LabelMapToLabelImageFilterType::Pointer labelImageConverter1 = LabelMapToLabelImageFilterType::New();
labelImageConverter1->SetInput(selector->GetOutput(1));
labelImageConverter1->Update();
mitk::Image::Pointer bp = mitk::ImportItkImage(labelImageConverter1->GetOutput());
LabelMapToLabelImageFilterType::Pointer labelImageConverter2 = LabelMapToLabelImageFilterType::New();
labelImageConverter2->SetInput(selector->GetOutput(0));
labelImageConverter2->Update();
mitk::Image::Pointer ap = mitk::ImportItkImage(labelImageConverter2->GetOutput());
LabelMapToLabelImageFilterType::Pointer labelImageConverter = LabelMapToLabelImageFilterType::New();
labelImageConverter->SetInput(selector->GetOutput(0));
labelImageConverter->Update();
mitk::Image::Pointer ap = mitk::ImportItkImage(labelImageConverter->GetOutput());
mitk::Image::Pointer bp = mitk::IOUtil::Load<mitk::Image>(directory.toStdString() + mitk::IOUtil::GetDirectorySeparator() + "PVeinsCroppedImage.nii");

//Ask for user input to set the parameters
QDialog* inputs = new QDialog(0,0);
Expand Down

0 comments on commit 352da9b

Please sign in to comment.