diff --git a/Documentation/Doxygen/2-UserManual/Applications.dox b/Documentation/Doxygen/2-UserManual/Applications.dox index 6ffd3c0af2..30399faa7f 100644 --- a/Documentation/Doxygen/2-UserManual/Applications.dox +++ b/Documentation/Doxygen/2-UserManual/Applications.dox @@ -1,33 +1,30 @@ /** \page ApplicationsPage Using MITK and Applications \tableofcontents \section ApplicationsPageApplications What are Applications? Applications are special versions of MITK which contain functionality aimed at solving a special task. Usually they are aimed at a selective audience or solving a particular problem. As such they focus on certain capabilities of MITK, while ignoring others. The main reason for this is to supply the users of the application with the power of MITK for solving their tasks, without daunting them with an overwhelming number of menus and options. At the same time, this allows the creation of an elegant and easily comprehensible workflow for your task. -The Diffusion Imaging Application for example contains all the functionality necessary for the field of neuro-imaging, but does not contain support for ultrasound imaging. A typical example of this would be an application which contains only views related to the analysis of the human brain (particular question) or one which contains only what is necessary for displaying medical data in the classroom (specific audience). \section ApplicationsPageWhatAmIUsing Which Application am I using? If you are unsure which application you are currently using, start the application and have a look in the Title Bar. You should see it's name there. \imageMacro{ApplicationTitle.jpg,"The application name is displayed in the title bar",16} \section ApplicationsPageApplicationsList List of Applications If you are interested in using a specific application, currently developed by the MITK team you might want to take a look first at the \ref MITKUserManualPage . Further information on any application can be found here: -*/ \ No newline at end of file +*/ diff --git a/Documentation/Doxygen/3-DeveloperManual/Starting/Architecture.dox b/Documentation/Doxygen/3-DeveloperManual/Starting/Architecture.dox index 912a2a1cef..4387b2c242 100644 --- a/Documentation/Doxygen/3-DeveloperManual/Starting/Architecture.dox +++ b/Documentation/Doxygen/3-DeveloperManual/Starting/Architecture.dox @@ -1,47 +1,47 @@ /** \page Architecture The Architecture of MITK MITK is an open source software toolkit for medical image processing, subsequent data analysis and integration of medical hardware. It is designed with the aim of providing a modular and reusable code base to enable rapid development of new features. Following this design philosophy, MITK includes many specialized modules. This document is aimed at giving an overview of the general structure of MITK. It will give you an introduction to the coding and design concepts behind the toolkit. \section OverviewPage_DesignOverview Design Overview MITK is designed to be used either as a pure software library or as a complete application framework. Thus, a user of MITK can decide if he or she simply wants to add a new plug-in to the existing application framework or to implement an own application by using MITK as a software library. Depending on the type of use MITK uses different software libraries, which is shown in the next figure for overview. \imageMacro{MitkOverview.png,"Overview of MITK",16} As shown above, MITK uses the following libraries. These are the main libraries MITK is based on. For more functionality you can optionally include other libraries as well. A list of used libraries can be found \ref thirdpartylibs "here" . Based on these libraries, MITK includes the following features: */ diff --git a/Modules/Classification/CLMiniApps/CMakeLists.txt b/Modules/Classification/CLMiniApps/CMakeLists.txt index 0bb6f5e560..162e071d36 100644 --- a/Modules/Classification/CLMiniApps/CMakeLists.txt +++ b/Modules/Classification/CLMiniApps/CMakeLists.txt @@ -1,122 +1,120 @@ option(BUILD_ClassificationMiniApps "Build commandline tools for classification" OFF) if(BUILD_ClassificationMiniApps OR MITK_BUILD_ALL_APPS) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ) # list of miniapps # if an app requires additional dependencies # they are added after a "^^" and separated by "_" set( classificationminiapps RandomForestTraining^^MitkCLVigraRandomForest NativeHeadCTSegmentation^^MitkCLVigraRandomForest ManualSegmentationEvaluation^^MitkCLVigraRandomForest CLScreenshot^^MitkCore_MitkQtWidgetsExt_MitkCLUtilities CLDicom2Nrrd^^MitkCore CLResampleImageToReference^^MitkCore CLGlobalImageFeatures^^MitkCLUtilities_MitkQtWidgetsExt CLMRNormalization^^MitkCLUtilities_MitkCLMRUtilities CLStaple^^MitkCLUtilities CLVoxelFeatures^^MitkCLUtilities CLPolyToNrrd^^ CLPlanarFigureToNrrd^^MitkCore_MitkSegmentation_MitkMultilabel CLSimpleVoxelClassification^^MitkDataCollection_MitkCLVigraRandomForest CLVoxelClassification^^MitkDataCollection_MitkCLImportanceWeighting_MitkCLVigraRandomForest CLBrainMask^^MitkCLUtilities XRaxSimulationFromCT^^MitkCLUtilities CLRandomSampling^^MitkCore_MitkCLUtilities CLRemoveEmptyVoxels^^MitkCore CLN4^^MitkCore CLSkullMask^^MitkCore CLPointSetToSegmentation^^ CLMultiForestPrediction^^MitkDataCollection_MitkCLVigraRandomForest CLNrrdToPoly^^MitkCore CL2Dto3DImage^^MitkCore CLWeighting^^MitkCore_MitkCLImportanceWeighting_MitkCLUtilities CLOverlayRoiCenterOfMass^^MitkCore_MitkCLUtilities_MitkQtWidgetsExt CLLungSegmentation^^MitkCore_MitkSegmentation_MitkMultilabel # RandomForestPrediction^^MitkCLVigraRandomForest ) foreach(classificationminiapps ${classificationminiapps}) # extract mini app name and dependencies string(REPLACE "^^" "\\;" miniapp_info ${classificationminiapps}) set(miniapp_info_list ${miniapp_info}) list(GET miniapp_info_list 0 appname) list(GET miniapp_info_list 1 raw_dependencies) string(REPLACE "_" "\\;" dependencies "${raw_dependencies}") set(dependencies_list ${dependencies}) mitk_create_executable(${appname} DEPENDS MitkCore MitkCLCore MitkCommandLine ${dependencies_list} PACKAGE_DEPENDS ITK Qt5|Core Vigra CPP_FILES ${appname}.cpp ) # CPP_FILES ${appname}.cpp mitkCommandLineParser.cpp if(EXECUTABLE_IS_ENABLED) # On Linux, create a shell script to start a relocatable application if(UNIX AND NOT APPLE) install(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME ${EXECUTABLE_TARGET}.sh) endif() get_target_property(_is_bundle ${EXECUTABLE_TARGET} MACOSX_BUNDLE) if(APPLE) if(_is_bundle) set(_target_locations ${EXECUTABLE_TARGET}.app) set(${_target_locations}_qt_plugins_install_dir ${EXECUTABLE_TARGET}.app/Contents/MacOS) set(_bundle_dest_dir ${EXECUTABLE_TARGET}.app/Contents/MacOS) set(_qt_plugins_for_current_bundle ${EXECUTABLE_TARGET}.app/Contents/MacOS) set(_qt_conf_install_dirs ${EXECUTABLE_TARGET}.app/Contents/Resources) install(TARGETS ${EXECUTABLE_TARGET} BUNDLE DESTINATION . ) else() if(NOT MACOSX_BUNDLE_NAMES) set(_qt_conf_install_dirs bin) set(_target_locations bin/${EXECUTABLE_TARGET}) set(${_target_locations}_qt_plugins_install_dir bin) install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION bin) else() foreach(bundle_name ${MACOSX_BUNDLE_NAMES}) list(APPEND _qt_conf_install_dirs ${bundle_name}.app/Contents/Resources) set(_current_target_location ${bundle_name}.app/Contents/MacOS/${EXECUTABLE_TARGET}) list(APPEND _target_locations ${_current_target_location}) set(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) message( " set(${_current_target_location}_qt_plugins_install_dir ${bundle_name}.app/Contents/MacOS) ") install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION ${bundle_name}.app/Contents/MacOS/) endforeach() endif() endif() else() set(_target_locations bin/${EXECUTABLE_TARGET}${CMAKE_EXECUTABLE_SUFFIX}) set(${_target_locations}_qt_plugins_install_dir bin) set(_qt_conf_install_dirs bin) install(TARGETS ${EXECUTABLE_TARGET} RUNTIME DESTINATION bin) endif() endif() endforeach() - # This mini app does not depend on mitkDiffusionImaging at all - mitk_create_executable(CLMatchPointReg DEPENDS MitkCore MitkCLUtilities MitkMatchPointRegistration MitkCommandLine MitkMatchPointRegistrationUI PACKAGE_DEPENDS ITK Qt5|Core Vigra MatchPoint - CPP_FILES CLMatchPointReg.cpp + CPP_FILES CLMatchPointReg.cpp ) # On Linux, create a shell script to start a relocatable application if(UNIX AND NOT APPLE) install(PROGRAMS "${MITK_SOURCE_DIR}/CMake/RunInstalledApp.sh" DESTINATION "." RENAME ${EXECUTABLE_TARGET}.sh) endif() if(EXECUTABLE_IS_ENABLED) MITK_INSTALL_TARGETS(EXECUTABLES ${EXECUTABLE_TARGET}) endif() endif() diff --git a/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionWriter.h b/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionWriter.h index 5fdf9917b2..95a6eae1d3 100755 --- a/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionWriter.h +++ b/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionWriter.h @@ -1,77 +1,69 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITK_COLLECTION_WRITER_H #define MITK_COLLECTION_WRITER_H //#include "mitkCommon.h" #include "mitkDataCollection.h" #include "mitkCollectionReader.h" #include namespace mitk { class MITKDATACOLLECTION_EXPORT CollectionWriter { public: - - typedef float TensorScalar; /** * @brief ExportCollectionToFolder * * Creates an XML file and stores all data in the same folder as the xml file (creating sub-folders for sub-collections) * - * - * Naming Conventions (Neccessary for proper saving of these images): - * DWI - Diffusion Weighted Images - * DTI - Diffusion Tensor Images - * FIB - Fiber Bundles - * * @param dataCollection * @param xmlFile * @param filter - (optional) only items with names contained in this list are written, if list is empty all items are written * @return */ static bool ExportCollectionToFolder(DataCollection* dataCollection, std::string xmlFile , std::vector filter); static bool ExportCollectionToFolder(DataCollection* dataCollection, std::string xmlFile); /** * @brief SaveCollection - Stores data collection at original location * * Writes the collection back to the files given in the original XML file. * New data items are stored into the default location, which is relative to the XML file. * * If a XML file is provided the files are stored as stated above with the differences that a new XML file is generated and new files are saved * relative to the newly generated xml. * * @param dataCollection * @param filter * @param xmlFile * @return */ static bool SaveCollection(DataCollection* dataCollection, std::vector filter, std::string xmlFile = ""); static bool FolderToXml(std::string folder, std::string collectionType, std::string xmlFile, std::vector filter, std::vector seriesNames); // GTV last entry in filter list, this item will be made to TARGET static bool SingleFolderToXml(std::string folder, std::string xmlFile, std::vector filter, std::vector seriesNames, bool longDate = true, int skipUntil = 0, float months = 0); protected: private: static size_t GetIndexForinXMonths(CollectionReader::FileListType fileList, float months, size_t curIndex, std::vector filter); }; } // namespace mitk #endif /* MITK_COLLECTION_WRITER_H */ diff --git a/Modules/Core/include/vtkMitkLevelWindowFilter.h b/Modules/Core/include/vtkMitkLevelWindowFilter.h index c1604f429a..6b4d7caad7 100644 --- a/Modules/Core/include/vtkMitkLevelWindowFilter.h +++ b/Modules/Core/include/vtkMitkLevelWindowFilter.h @@ -1,98 +1,97 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef __vtkMitkLevelWindowFilter_h #define __vtkMitkLevelWindowFilter_h class vtkScalarsToColors; class vtkPiecewiseFunction; #include #include #include /** Documentation * \brief Applies the grayvalue or color/opacity level window to scalar or RGB(A) images. * -* This filter is used to apply the color level window to RGB images (e.g. -* diffusion tensor images). Therefore, the RGB channels are converted to -* the HSI color space, where the level window can be applied. Afterwards, -* the HSI values transformed back to the RGB space. +* This filter is used to apply the color level window to RGB images. +* Therefore, the RGB channels are converted to the HSI color space, where the level +* window can be applied. Afterwards, the HSI values transformed back to the RGB space. * * The filter is also able to apply an opacity level window to RGBA images. * * \ingroup Renderer */ class MITKCORE_EXPORT vtkMitkLevelWindowFilter : public vtkThreadedImageAlgorithm { public: vtkTypeMacro(vtkMitkLevelWindowFilter, vtkThreadedImageAlgorithm); static vtkMitkLevelWindowFilter *New(); vtkMTimeType GetMTime() override; /** \brief Get the lookup table for the RGB level window */ vtkScalarsToColors *GetLookupTable(); /** \brief Set the lookup table for the RGB level window */ void SetLookupTable(vtkScalarsToColors *lookupTable); /** \brief Get the piecewise function used to map scalar to alpha component value (only * used when the lookupTable is a vtkColorTransferFunction) */ vtkPiecewiseFunction *GetOpacityPiecewiseFunction() { return m_OpacityFunction; } /** \brief Set the piecewise function used to map scalar to alpha component value (only * used when the lookupTable is a vtkColorTransferFunction) */ void SetOpacityPiecewiseFunction(vtkPiecewiseFunction *opacityFunction); /** \brief Get/Set the lower window opacity for the alpha level window */ void SetMinOpacity(double minOpacity); inline double GetMinOpacity() const; /** \brief Get/Set the upper window opacity for the alpha level window */ void SetMaxOpacity(double maxOpacity); inline double GetMaxOpacity() const; /** \brief Set clipping bounds for the opaque part of the resliced 2d image */ void SetClippingBounds(double *); protected: /** Default constructor. */ vtkMitkLevelWindowFilter(); /** Default deconstructor. */ ~vtkMitkLevelWindowFilter() override; /** \brief Method for threaded execution of the filter. * \param *inData: The input. * \param *outData: The output of the filter. * \param extent: Specifies the region of the image to be updated inside this thread. * It is a six-component array of the form (xmin, xmax, ymin, ymax, zmin, zmax). * \param id: The thread id. */ void ThreadedExecute(vtkImageData *inData, vtkImageData *outData, int extent[6], int id) override; // /** Standard VTK filter method to apply the filter. See VTK documentation.*/ int RequestInformation(vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) override; // /** Standard VTK filter method to apply the filter. See VTK documentation. Not used at the moment.*/ // void ExecuteInformation(vtkImageData *vtkNotUsed(inData), vtkImageData *vtkNotUsed(outData)); private: /** m_LookupTable contains the lookup table for the RGB level window.*/ vtkScalarsToColors *m_LookupTable; /** The transfer function to map the scalar to alpha (4th component of the RGBA output value) */ vtkPiecewiseFunction *m_OpacityFunction; /** m_MinOpacity contains the lower bound for the alpha level window.*/ double m_MinOpacity; /** m_MaxOpacity contains the upper bound for the alpha level window.*/ double m_MaxOpacity; double m_ClippingBounds[4]; }; #endif diff --git a/Modules/DICOMReader/doc/Doxygen/Modules.dox b/Modules/DICOMReader/doc/Doxygen/Modules.dox index a23b919558..2867b4a88e 100644 --- a/Modules/DICOMReader/doc/Doxygen/Modules.dox +++ b/Modules/DICOMReader/doc/Doxygen/Modules.dox @@ -1,39 +1,38 @@ /** \defgroup DICOMReaderModule The DICOMReader Module \ingroup MITKModules \brief DICOM This module contains a number of classes for DICOM image loading within MITK. \section DICOMReaderModule_overview Scope When people around MITK talk about loading DICOM images or series, they are really not interested in the images (2D slices) but in a 3D mitk::Image instance that groups DICOM images in a meaningful way. The task of this module is to provide - an interface for the general "DICOM files to mitk::Images" transformation: mitk::DICOMFileReader - a flexible default reader for the most common DICOM images: mitk::DICOMITKSeriesGDCMReader Most documentation is kept with these classes, so please have a look at their documentations. \remark Prior to this module, a class called DicomSeriesReader grew too much to be maintainable anymore. Its functionality is conserved by class mitk::ClassicDICOMSeriesReader. \section DICOMReaderModule_interface Module Interface The general loading proceduce is structured by mitk::DICOMFileReader, under the assumption that the best reader for a set of files is not known prior to inspection. To facilitate applications that need to select between possible readers based on what would be loaded, file readers are required to implement loading in two separate steps: 1. analysis of a list of files and description of potential mitk::Image%s by means of mitk::DICOMImageBlockDescriptor 2. actual loading of pixel data into mitk::Image%s A very simple implementation is mitk::DICOMFileReaderSelector which selects the reader with the least possible number of mitk::Images (least confusing for the user?). \section DICOMReaderModule_tasks Tasks for future development Unstructured development tasks and ideas for future extensions - - a reader for vector-valued diffusion images is currently being implemented - a multi-frame image reader based on DCMTK - perspective: slice-by-slice loading */ diff --git a/Modules/SceneSerialization/src/mitkSceneReaderV1.cpp b/Modules/SceneSerialization/src/mitkSceneReaderV1.cpp index 2775433865..adc64156f3 100644 --- a/Modules/SceneSerialization/src/mitkSceneReaderV1.cpp +++ b/Modules/SceneSerialization/src/mitkSceneReaderV1.cpp @@ -1,425 +1,421 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "mitkSceneReaderV1.h" #include "Poco/Path.h" #include "mitkBaseRenderer.h" #include "mitkIOUtil.h" #include "mitkProgressBar.h" #include "mitkPropertyListDeserializer.h" #include "mitkSerializerMacros.h" #include MITK_REGISTER_SERIALIZER(SceneReaderV1) namespace { typedef std::pair> NodesAndParentsPair; bool NodeSortByLayerIsLessThan(const NodesAndParentsPair &left, const NodesAndParentsPair &right) { if (left.first.IsNotNull() && right.first.IsNotNull()) { int leftLayer; int rightLayer; if (left.first->GetIntProperty("layer", leftLayer) && right.first->GetIntProperty("layer", rightLayer)) { return leftLayer < rightLayer; } else { // fall back to name sort return left.first->GetName() < right.first->GetName(); } } // in all other cases, fall back to stupid pointer comparison // this is not reasonable but at least answers the sorting // question clearly return left.first.GetPointer() < right.first.GetPointer(); } } bool mitk::SceneReaderV1::LoadScene(TiXmlDocument &document, const std::string &workingDirectory, DataStorage *storage) { assert(storage); bool error(false); // TODO prepare to detect errors (such as cycles) from wrongly written or edited xml files // Get number of elements to initialze progress bar // 1. if there is a element, // - construct a name for the appropriate serializer // - try to instantiate this serializer via itk object factory // - if serializer could be created, use it to read the file into a BaseData object // - if successful, call the new node's SetData(..) // create a node for the tag "data" and test if node was created typedef std::vector DataNodeVector; DataNodeVector DataNodes; unsigned int listSize = 0; for (TiXmlElement *element = document.FirstChildElement("node"); element != nullptr; element = element->NextSiblingElement("node")) { ++listSize; } ProgressBar::GetInstance()->AddStepsToDo(listSize * 2); for (TiXmlElement *element = document.FirstChildElement("node"); element != nullptr; element = element->NextSiblingElement("node")) { DataNodes.push_back(LoadBaseDataFromDataTag(element->FirstChildElement("data"), workingDirectory, error)); ProgressBar::GetInstance()->Progress(); } // iterate all nodes // first level nodes should be elements auto nit = DataNodes.begin(); for (TiXmlElement *element = document.FirstChildElement("node"); element != nullptr || nit != DataNodes.end(); element = element->NextSiblingElement("node"), ++nit) { mitk::DataNode::Pointer node = *nit; // in case dataXmlElement is valid test whether it containts the "properties" child tag // and process further if and only if yes TiXmlElement *dataXmlElement = element->FirstChildElement("data"); if (dataXmlElement && dataXmlElement->FirstChildElement("properties")) { TiXmlElement *baseDataElement = dataXmlElement->FirstChildElement("properties"); if (node->GetData()) { DecorateBaseDataWithProperties(node->GetData(), baseDataElement, workingDirectory); } else { MITK_WARN << "BaseData properties stored in scene file, but BaseData could not be read" << std::endl; } } // 2. check child nodes const char *uida = element->Attribute("UID"); std::string uid(""); if (uida) { uid = uida; m_NodeForID[uid] = node.GetPointer(); m_IDForNode[node.GetPointer()] = uid; } else { MITK_ERROR << "No UID found for current node. Node will have no parents."; error = true; } // 3. if there are nodes, // - instantiate the appropriate PropertyListDeSerializer // - use them to construct PropertyList objects // - add these properties to the node (if necessary, use renderwindow name) bool success = DecorateNodeWithProperties(node, element, workingDirectory); if (!success) { MITK_ERROR << "Could not load properties for node."; error = true; } // remember node for later adding to DataStorage m_OrderedNodePairs.push_back(std::make_pair(node, std::list())); // 4. if there are elements, remember parent objects for (TiXmlElement *source = element->FirstChildElement("source"); source != nullptr; source = source->NextSiblingElement("source")) { const char *sourceUID = source->Attribute("UID"); if (sourceUID) { m_OrderedNodePairs.back().second.push_back(std::string(sourceUID)); } } ProgressBar::GetInstance()->Progress(); } // end for all // sort our nodes by their "layer" property // (to be inserted in that order) m_OrderedNodePairs.sort(&NodeSortByLayerIsLessThan); // remove all unknown parent UIDs for (auto nodesIter = m_OrderedNodePairs.begin(); nodesIter != m_OrderedNodePairs.end(); ++nodesIter) { for (auto parentsIter = nodesIter->second.begin(); parentsIter != nodesIter->second.end();) { if (m_NodeForID.find(*parentsIter) == m_NodeForID.end()) { parentsIter = nodesIter->second.erase(parentsIter); MITK_WARN << "Found a DataNode with unknown parents. Will add it to DataStorage without any parent objects."; error = true; } else { ++parentsIter; } } } // repeat the following loop ... // ... for all created nodes unsigned int lastMapSize(0); while (lastMapSize != m_OrderedNodePairs .size()) // this is to prevent infinite loops; each iteration must at least add one node to DataStorage { lastMapSize = m_OrderedNodePairs.size(); // iterate (layer) ordered nodes backwards // we insert the highest layers first for (auto nodesIter = m_OrderedNodePairs.begin(); nodesIter != m_OrderedNodePairs.end(); ++nodesIter) { bool addThisNode(true); // if any parent node is not yet in DataStorage, skip node for now and check later for (auto parentsIter = nodesIter->second.begin(); parentsIter != nodesIter->second.end(); ++parentsIter) { if (!storage->Exists(m_NodeForID[*parentsIter])) { addThisNode = false; break; } } if (addThisNode) { DataStorage::SetOfObjects::Pointer parents = DataStorage::SetOfObjects::New(); for (auto parentsIter = nodesIter->second.begin(); parentsIter != nodesIter->second.end(); ++parentsIter) { parents->push_back(m_NodeForID[*parentsIter]); } // if all parents are found in datastorage (or are unknown), add node to DataStorage storage->Add(nodesIter->first, parents); // remove this node from m_OrderedNodePairs m_OrderedNodePairs.erase(nodesIter); // break this for loop because iterators are probably invalid break; } } } // All nodes that are still in m_OrderedNodePairs at this point are not part of a proper directed graph structure. // We'll add such nodes without any parent information. for (auto nodesIter = m_OrderedNodePairs.begin(); nodesIter != m_OrderedNodePairs.end(); ++nodesIter) { storage->Add(nodesIter->first); MITK_WARN << "Encountered node that is not part of a directed graph structure. Will be added to DataStorage " "without parents."; error = true; } return !error; } mitk::DataNode::Pointer mitk::SceneReaderV1::LoadBaseDataFromDataTag(TiXmlElement *dataElement, const std::string &workingDirectory, bool &error) { DataNode::Pointer node; if (dataElement) { const char *filename = dataElement->Attribute("file"); if (filename && strlen(filename) != 0) { try { std::vector baseData = IOUtil::Load(workingDirectory + Poco::Path::separator() + filename); if (baseData.size() > 1) { MITK_WARN << "Discarding multiple base data results from " << filename << " except the first one."; } node = DataNode::New(); node->SetData(baseData.front()); } catch (std::exception &e) { MITK_ERROR << "Error during attempt to read '" << filename << "'. Exception says: " << e.what(); error = true; } if (node.IsNull()) { MITK_ERROR << "Error during attempt to read '" << filename << "'. Factory returned nullptr object."; error = true; } } } // in case there was no element we create a new empty node (for appending a propertylist later) if (node.IsNull()) { node = DataNode::New(); } return node; } void mitk::SceneReaderV1::ClearNodePropertyListWithExceptions(DataNode &node, PropertyList &propertyList) { // Basically call propertyList.Clear(), but implement exceptions (see bug 19354) BaseData *data = node.GetData(); PropertyList::Pointer propertiesToKeep = PropertyList::New(); if (dynamic_cast(data)) { /* Older scene files (before changes of bug 17547) could contain a RenderingMode property with value "LevelWindow_Color". Since bug 17547 this value has been removed and replaced by the default value LookupTable_LevelWindow_Color. This new default value does only result in "black-to-white" CT images (or others) if there is a corresponding lookup table. Such a lookup table is provided as a default value by the Image mapper. Since that value was never present in older scene files, we do well in not removing the new default value here. Otherwise the mapper would fall back to another default which is all the colors of the rainbow :-( */ BaseProperty::Pointer lutProperty = propertyList.GetProperty("LookupTable"); propertiesToKeep->SetProperty("LookupTable", lutProperty); /* Older scene files (before changes of T14807) may contain multi-component images without the "Image.Displayed Component" property. As the treatment as multi-component image and the corresponding visualization options hinges on that property we should not delete it, if it was added by the mapper. - Old diffusion images might contain the "DisplayChannel" property - which stores the same information, however ignoring it is an acceptable - loss of precision as usually which channel is selected is not terribly - important. This is a fix for the issue reported in T19919. */ BaseProperty::Pointer compProperty = propertyList.GetProperty("Image.Displayed Component"); if (compProperty.IsNotNull()) { propertiesToKeep->SetProperty("Image.Displayed Component", compProperty); } } propertyList.Clear(); propertyList.ConcatenatePropertyList(propertiesToKeep); } bool mitk::SceneReaderV1::DecorateNodeWithProperties(DataNode *node, TiXmlElement *nodeElement, const std::string &workingDirectory) { assert(node); assert(nodeElement); bool error(false); for (TiXmlElement *properties = nodeElement->FirstChildElement("properties"); properties != nullptr; properties = properties->NextSiblingElement("properties")) { const char *propertiesfilea(properties->Attribute("file")); std::string propertiesfile(propertiesfilea ? propertiesfilea : ""); const char *renderwindowa(properties->Attribute("renderwindow")); std::string renderwindow(renderwindowa ? renderwindowa : ""); PropertyList::Pointer propertyList = node->GetPropertyList(renderwindow); // DataNode implementation always returns a propertylist ClearNodePropertyListWithExceptions(*node, *propertyList); // use deserializer to construct new properties PropertyListDeserializer::Pointer deserializer = PropertyListDeserializer::New(); deserializer->SetFilename(workingDirectory + Poco::Path::separator() + propertiesfile); bool success = deserializer->Deserialize(); error |= !success; PropertyList::Pointer readProperties = deserializer->GetOutput(); if (readProperties.IsNotNull()) { propertyList->ConcatenatePropertyList(readProperties, true); // true = replace } else { MITK_ERROR << "Property list reader did not return a property list. This is an implementation error. Please tell " "your developer."; error = true; } } return !error; } bool mitk::SceneReaderV1::DecorateBaseDataWithProperties(BaseData::Pointer data, TiXmlElement *baseDataNodeElem, const std::string &workingDir) { // check given variables, initialize error variable assert(baseDataNodeElem); bool error(false); // get the file name stored in the tag const char *baseDataPropertyFile(baseDataNodeElem->Attribute("file")); // check if the filename was found if (baseDataPropertyFile) { // PropertyList::Pointer dataPropList = data->GetPropertyList(); PropertyListDeserializer::Pointer propertyDeserializer = PropertyListDeserializer::New(); // initialize the property reader propertyDeserializer->SetFilename(workingDir + Poco::Path::separator() + baseDataPropertyFile); bool ioSuccess = propertyDeserializer->Deserialize(); error = !ioSuccess; // get the output PropertyList::Pointer inProperties = propertyDeserializer->GetOutput(); // store the read-in properties to the given node or throw error otherwise if (inProperties.IsNotNull()) { data->SetPropertyList(inProperties); } else { MITK_ERROR << "The property deserializer did not return a (valid) property list."; error = true; } } else { MITK_ERROR << "Function DecorateBaseDataWithProperties(...) called with false TiXmlElement. \n \t ->Given element " "does not contain a 'file' attribute. \n"; error = true; } return !error; } diff --git a/README.md b/README.md index 9402a64044..ff95bb0ea0 100644 --- a/README.md +++ b/README.md @@ -1,93 +1,93 @@ ![MITK Logo][logo] The [Medical Imaging Interaction Toolkit][mitk] (MITK) is a free open-source software system for development of interactive medical image processing software. MITK combines the [Insight Toolkit][itk] (ITK) and the [Visualization Toolkit][vtk] (VTK) with an application framework. The links below provide high-level and reference documentation targeting different usage scenarios: - Get a [high-level overview][mitk-overview] about MITK with pointers to further documentation - End-users looking for help with MITK applications should read the [MITK User Manual][mitk-usermanual] - Developers contributing to or using MITK, please see the [MITK Developer Manual][mitk-devmanual] as well as the [MITK API Reference][mitk-apiref] See the [MITK homepage][mitk] for details. Supported Platforms ------------------- MITK is a cross-platform C++ toolkit and officially supports: - Windows - Linux - macOS For details, please read the [Supported Platforms][platforms] page. License ------- Copyright (c) [German Cancer Research Center (DKFZ)][dkfz]. All rights reserved. MITK is available as free open-source software under a [3-clause BSD license][license]. Download -------- The MITK source code and binaries for the *MitkWorkbench* application are released regularly according to the [MITK release cycle][release-cycle]. See the [Download][download] page for a list of releases. -The official MITK source code is available in the [MITK Git repository][diffusion]. The Git clone command is +The official MITK source code is available in the [MITK Git repository][phab_repo]. The Git clone command is git clone https://phabricator.mitk.org/source/mitk.git MITK Active development takes place in the MITK master branch and its usage is advised for advanced users only. How to Contribute ----------------- Contributions of all kind are happily accepted. However, to make the contribution process as smooth as possible, please read the [How to contribute to MITK][contribute] page if you plan to contribute to MITK. Build Instructions ------------------ MITK uses [CMake][cmake] to configure a build tree. The following is a crash course about cloning, configuring, and building MITK on a Linux/Unix system: git clone https://phabricator.mitk.org/source/mitk.git MITK mkdir MITK-build cd MITK-build cmake ../MITK make -j4 Read the comprehensive [build instructions][build] page for details. Useful Links ------------ - [Homepage][mitk] - [Download][download] - [Mailing list][mailinglist] - [Issue tracker][bugs] [logo]: https://github.com/MITK/MITK/raw/master/mitk.png [mitk]: http://mitk.org [itk]: https://itk.org [vtk]: https://vtk.org [mitk-overview]: http://docs.mitk.org/nightly/Overview.html [mitk-usermanual]: http://docs.mitk.org/nightly/UserManualPortal.html [mitk-devmanual]: http://docs.mitk.org/nightly/DeveloperManualPortal.html [mitk-apiref]: http://docs.mitk.org/nightly/usergroup0.html [platforms]: http://docs.mitk.org/nightly/SupportedPlatformsPage.html [dkfz]: https://www.dkfz.de [license]: https://github.com/MITK/MITK/blob/master/LICENSE [release-cycle]: http://mitk.org/MitkReleaseCycle [download]: http://mitk.org/Download -[diffusion]: https://phabricator.mitk.org/source/mitk/ +[phab_repo]: https://phabricator.mitk.org/source/mitk/ [contribute]: http://mitk.org/How_to_contribute [cmake]: https://www.cmake.org [build]: http://docs.mitk.org/nightly/BuildInstructionsPage.html [mailinglist]: http://mitk.org/Mailinglist [bugs]: https://phabricator.mitk.org/maniphest/ diff --git a/Utilities/mbilog/mbilogTextDictionary.h b/Utilities/mbilog/mbilogTextDictionary.h index e84e599c81..f02953ec61 100644 --- a/Utilities/mbilog/mbilogTextDictionary.h +++ b/Utilities/mbilog/mbilogTextDictionary.h @@ -1,419 +1,416 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef _MBILOG_TEXTDICTIONARY_H_ #define _MBILOG_TEXTDICTIONARY_H_ namespace mbilog { /** \brief This is a dictionary to replace long names of classes, * modules, etc. to shorter versions in the console output. */ static const char *replace[] = {".cpp", "", ".cxx", "", ".txx", "", ".h", "", ".hpp", "", ".hxx", "", ".c", "", "org.blueberry.", "", "org.mitk.gui.qt.", "", "org.mitk.", "", "qmitk", "", "mitk", "", "berry", "", "itk", "", "vtk", "", "qt", "", "object", "obj", "factory", "fac", "classes", "cls", "plugin", "plg", "widget", "wdgt", "interface", "itf", "service", "svc", "register", "reg", "perspective", "prs", "assessor", "ase", "atrophy", "atr", "bias", "bias", "field", "fld", "multi", "mlt", "contour", "cntr", "tools", "tls", "tool", "tl", "application", "app", "calculate", "calc", "subtract", "sub", "region", "reg", "tumor", "tum", "growing", "grow", "segmentation", "seg", "statistics", "stat", "imaging", "img", "image", "img", - "diffusion", - "dif", "registration", "reg", "navigation", "nav", "generation", "gen", "generator", "gen", "vector", "vec", "gradient", "grad", "flow", "flow", "paint", "pnt", "brush", "brsh", "volumetry", "vol", "volume", "vol", "mapper", "map", "filter", "flt", "surface", "sfc", "point", "pnt", "organ", "org", "multiple", "mlt", "corrector", "cor", "correction", "cor", "batch", "bat", "window", "wnd", "advisor", "adv", "editor", "edt", "material", "mat", "visualization", "vis", "measurement", "mes", "scene", "scn", "serialization", "ser", "deserializer", "dser", "serializer", "ser", "sandbox", "sb", "texture", "tex", "opengl", "ogl", "vessel", "vsl", "value", "val", "analysis", "ana", "patient", "pat", "body", "body", "diagnosis", "diag", "mesh", "mesh", "radial", "rad", "simple", "smp", "algorithms", "alg", "controllers", "con", "control", "con", "interactive", "ia", "interactions", "ia", "processing", "pro", "process", "pro", "rendering", "rnd", "renderer", "rnd", "render", "rnd", "datamanagement", "data", "management", "mng", "manager", "mng", "data", "data", "anatomy", "ana", "neuro", "neo", "automatic", "auto", "optimizer", "opt", "optimize", "opt", "binary", "bin", "liver", "liv", "lymph", "lym", "node", "node", "tree", "tree", "homogeneous", "hmgn", "threshold", "tsh", - // "shapebased", "shp", "based", "bsd", "shape", "shp", "model", "mdl", "extension", "ext", "activator", "act", "dicom", "dicom", "browser", "brwr", "viewer", "view", "view", "view", "finder", "fnd", "indexer", "idx", "index", "idx", "rapid", "rpd", "gui", "gui", "slices", "slc", "slice", "slc", "about", "abt", "interpolator", "inp", "switcher", "swh", "planarfigure", "pfig", "planning", "plan", "planner", "plan", "plane", "pln", "plan", "plan", "label", "lbl", "geometry", "geom", "workbench", "wrkbnc", "common", "com", "resection", "rsc", "translation", "trnsl", "rotation", "rot", "deformation", "dfrm", "shader", "shd", "repository", "rep", "initializer", "init", "dialog", "dlg", "download", "down", "upload", "up", "core", "core", "manual", "man", "leaf", "leaf", "internal", "int", "external", "ext", "platform", "pltfm", "method", "mthd", "pyramidal", "prmdl", "tracking", "trck", "track", "trck", "bspline", "bspl", "spline", "spl", "create", "crt", "erase", "ers", "auto", "auto", "crop", "crop", "file", "file", "io", "io", "2d", "2d", "3d", "3d", ".", "."}; } #endif