#Documentation # @brief Interactively add points # # As in Step4, load one or more data sets (many image, # surface and other formats) and create 3 views on the data. # Additionally, we want to interactively add points. A node containing # a PointSet as data is added to the data tree and a PointSetDataInteractor # is associated with the node, which handles the interaction. The # @em interaction @e
| 44 | //## may be "empty point set") and associated @a actions (e.g., add a point |
| 45 | //## at the position where the mouse-click occurred). |
| 46 | int main(int argc, char *argv[]) |
| 47 | { |
| 48 | QApplication qtapplication(argc, argv); |
| 49 | |
| 50 | if (argc < 2) |
| 51 | { |
| 52 | fprintf( |
| 53 | stderr, "Usage: %s [filename1] [filename2] ...\n\n", itksys::SystemTools::GetFilenameName(argv[0]).c_str()); |
| 54 | return 1; |
| 55 | } |
| 56 | |
| 57 | // Register Qmitk-dependent global instances |
| 58 | QmitkRegisterClasses(); |
| 59 | |
| 60 | //************************************************************************* |
| 61 | // Part I: Basic initialization |
| 62 | //************************************************************************* |
| 63 | |
| 64 | // Create a DataStorage |
| 65 | mitk::StandaloneDataStorage::Pointer ds = mitk::StandaloneDataStorage::New(); |
| 66 | |
| 67 | //************************************************************************* |
| 68 | // Part II: Create some data by reading files |
| 69 | //************************************************************************* |
| 70 | int i; |
| 71 | for (i = 1; i < argc; ++i) |
| 72 | { |
| 73 | // For testing |
| 74 | if (strcmp(argv[i], "-testing") == 0) |
| 75 | continue; |
| 76 | |
| 77 | // Load datanode (eg. many image formats, surface formats, etc.) |
| 78 | mitk::StandaloneDataStorage::SetOfObjects::Pointer dataNodes = mitk::IOUtil::Load(argv[i], *ds); |
| 79 | |
| 80 | //********************************************************************* |
| 81 | // Part III: Put the data into the datastorage |
| 82 | //********************************************************************* |
| 83 | // Add the node to the DataStorage |
| 84 | if (dataNodes->empty()) |
| 85 | { |
| 86 | fprintf(stderr, "Could not open file %s \n\n", argv[i]); |
| 87 | exit(2); |
| 88 | } |
| 89 | } |
| 90 | |
| 91 | //************************************************************************* |
| 92 | // Part V: Create windows and pass the tree to it |
| 93 | //************************************************************************* |
| 94 | |
| 95 | // Create toplevel widget with horizontal layout |
| 96 | QWidget toplevelWidget; |
| 97 | QHBoxLayout layout; |
| 98 | layout.setSpacing(2); |
| 99 | layout.setContentsMargins({}); |
| 100 | toplevelWidget.setLayout(&layout); |
| 101 | |
| 102 | //************************************************************************* |
| 103 | // Part Va: 3D view |
nothing calls this directly
no test coverage detected