X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=src%2FcreaImageIOWxGimmick.cpp;h=4b8f3f3f76dbc77d6716617baa36dc5224249b51;hb=48959b03ebd4e0d100f468f6c05c873f70b43516;hp=3e744982e179fec219f04c1b232bd2090b9310f1;hpb=46d6077cd663d529fb3f083001e9fee330da7fb8;p=creaImageIO.git diff --git a/src/creaImageIOWxGimmick.cpp b/src/creaImageIOWxGimmick.cpp index 3e74498..4b8f3f3 100644 --- a/src/creaImageIOWxGimmick.cpp +++ b/src/creaImageIOWxGimmick.cpp @@ -63,6 +63,8 @@ namespace creaImageIO PopUp_Settings = 501, PopUp_About = 502, PopUp_User = WxGimmick::UserMenuFirstId, + PopUp_SaveAs = 701, + PopUp_AddToFavorites = 702 }; //================================================================ @@ -931,10 +933,13 @@ namespace creaImageIO { wxBusyCursor busy; // std::cout << "WxGimmick : Reading config"< Loading collections from '"< Loading collections from '"< ERROR opening collection '"< File does not exist. It will be created on exit (if you already ran Gimmick! and exited normally, this is not normal. Send a bug report)."); } @@ -1023,6 +1028,13 @@ namespace creaImageIO } //================================================================ + //================================================================ + void WxGimmick::LoadOrCreateFavoritesDatabase() + { + // TODO + } + //================================================================ + /* //================================================================ void WxGimmick::OnClose(wxCloseEvent& event) @@ -1991,7 +2003,7 @@ namespace creaImageIO } sib = GetTreeListCtrl()->GetNextSibling(sib); } - prio = maxprio + 1000; + prio = maxprio + 999; sib = GetTreeListCtrl()->GetPrevSibling(item); while (sib.IsOk()) { @@ -2034,13 +2046,17 @@ namespace creaImageIO void WxGimmick::ShowImage(vtkImageData* im) { // wxBusyCursor busy; + mViewer->SetInput( im ); + mViewer->SetSlice( 0 ); + int x1,x2,y1,y2,z1,z2; double spx,spy,spz; + im->Update(); im->GetSpacing(spx,spy,spz); im->GetExtent (x1,x2,y1,y2,z1,z2); - /* + std::cout << "-----------------------------"<GetScalarRange(); + mViewer->SetColorWindow(range[1] - range[0]); + mViewer->SetColorLevel(0.5 * (range[1] + range[0])); + + mViewer->GetRenderer()->ResetCamera(); + double bounds[6]; + + + mViewer->GetRenderer()->ComputeVisiblePropBounds(bounds); + + /* + std::cout <<"bounds : "<GetRenderer()->ResetCameraClippingRange(bounds); + /* vtkCamera *camera = mViewer->GetRenderer()->GetActiveCamera(); camera->SetViewUp ( spx*0, -spy*1, spz*0); - camera->SetPosition( spx*(x1+x2)/2, spy*(y1+y2)/2, -spz*10000000); + camera->SetPosition( spx*(x1+x2)/2, spy*(y1+y2)/2, spz*10000000); camera->SetFocalPoint ( spx*(x1+x2)/2 , spy*(y1+y2)/2 , spz*0); camera->ComputeViewPlaneNormal(); camera->SetParallelScale( spx*(x2-x1)/2.0 ); + camera->Roll ( 180 ); + */ } - mViewer->SetInput( im ); - mViewer->SetSlice( 0 ); mInteractor->Render(); } //================================================================ @@ -2269,6 +2305,10 @@ namespace creaImageIO ext[5] = im.size(); out->SetExtent(ext); // LG : TODO : Z Spacing ? + // + // ==> to get an accurate ZSpacing from a Dicom set of files + // ==> you need a gdcm::SerieHelper + // JPR out->AllocateScalars();