Hi Micheal Cheers for getting back to me. In the end I recoded the program to use the DataNodeFactory and read the tiff file in that way. I'm not sure what tiff files I'm using(I made them in matlab and save them as .tif ). however I know that they are binary.
regards tom On 07/08/2012 15:35, Brehler, Michael wrote: > Hi Tom, > > Sorry for the late reply, what sort of tiff files are you using? MITK does > not fully support tiff images (seehttp://bugs.mitk.org/show_bug.cgi?id=10823 > andhttp://bugs.mitk.org/show_bug.cgi?id=12811 ) but we are discussing the > problem. If you still have a problem could you please give us further details? > > Best regards > Michael > > -----Ursprüngliche Nachricht----- > Von: tom [mailto:[email protected]] > Gesendet: Montag, 23. Juli 2012 15:12 > An:[email protected] > Betreff: [mitk-users] viewing tiff file problems > > Hi guys > I'm trying to read in some tiff files. but it doesn't display them right. > (just get a few while pixels in a file across the screen). > I'm using the itkimagefilereader class and setting the imageio to tiff. > then i cast the itk image to a temp mitk image and use the mitk temp to > Initialize a new mitk image. i then send the new mitk image to a data node > and then visualize the node. > > the code i wrote is below. > > reader = mitk::ImageSource::New(); > typedef unsigned char PixelType; > typedef itk::Image< PixelType, 1> ImageType; > > itk::ImageFileReader<ImageType>::Pointer Read = > itk::ImageFileReader<ImageType>::New(); > itk::TIFFImageIO::Pointer tiffReader = itk::TIFFImageIO::New(); > QByteArray temp = fileName.toLocal8Bit(); > const char * filename = temp.data(); > > try > { > Read->SetFileName(filename); > Read->SetImageIO(tiffReader); > Read->Update(); > > ImageType::Pointer image = Read->GetOutput(); > > mitkOutputImage = mitk::Image::New(); > mitk::Image::Pointer temp = mitk::Image::New(); > > mitk::CastToMitkImage(image, temp); > > mitkOutputImage->Initialize(temp); > } > catch(...) > { > printf( stderr, "Could not open file %s \n\n", filename ); > exit(2); > } > this->SetupWidgets(); > this->setCentralWidget(toplevelWidge); > } > > void tester::SetupWidgets() > { > > toplevelWidge = new QWidget() ; > //toplevelWidge -> resize(1000,700); > > QGridLayout* layout = new QGridLayout(toplevelWidge); > toplevelWidge->setLayout(layout); > layout->setSpacing(2); > layout->setMargin(0); > > mitk::DataNode::Pointer node = mitk::DataNode::New(); > node->SetData(mitkOutputImage); > > mitk::StandaloneDataStorage::Pointer ds = > mitk::StandaloneDataStorage::New(); > ds->Add(node); > > > mitk::PointSet::Pointer pointSet = mitk::PointSet::New(); > mitk::DataNode::Pointer pointSetNode = mitk::DataNode::New(); > pointSetNode->SetData(pointSet); > > ds->Add(pointSetNode); > > mitk::GlobalInteraction::GetInstance()->AddInteractor( > mitk::PointSetInteractor::New("pointsetinteractor", pointSetNode) ); > > QmitkRenderWindow* renderWindow = new QmitkRenderWindow(toplevelWidge); > layout->addWidget(renderWindow); > > renderWindow->GetRenderer()->SetDataStorage(ds); > > mitk::RenderingManager::GetInstance()->InitializeViews(); > > } > any help to were I'm going wrong would be brilliant > kind regards > Tom > > [FW1] > -- Rhif Elusen Gofrestredig / Registered Charity No. 1141565 Gall y neges e-bost hon, ac unrhyw atodiadau a anfonwyd gyda hi, gynnwys deunydd cyfrinachol ac wedi eu bwriadu i'w defnyddio'n unig gan y sawl y cawsant eu cyfeirio ato (atynt). Os ydych wedi derbyn y neges e-bost hon trwy gamgymeriad, rhowch wybod i'r anfonwr ar unwaith a dilëwch y neges. Os na fwriadwyd anfon y neges atoch chi, rhaid i chi beidio â defnyddio, cadw neu ddatgelu unrhyw wybodaeth a gynhwysir ynddi. Mae unrhyw farn neu safbwynt yn eiddo i'r sawl a'i hanfonodd yn unig ac nid yw o anghenraid yn cynrychioli barn Prifysgol Bangor. Nid yw Prifysgol Bangor yn gwarantu bod y neges e-bost hon neu unrhyw atodiadau yn rhydd rhag firysau neu 100% yn ddiogel. Oni bai fod hyn wedi ei ddatgan yn uniongyrchol yn nhestun yr e-bost, nid bwriad y neges e-bost hon yw ffurfio contract rhwymol - mae rhestr o lofnodwyr awdurdodedig ar gael o Swyddfa Cyllid Prifysgol Bangor. www.bangor.ac.uk This email and any attachments may contain confidential material and is solely for the use of the intended recipient(s). If you have received this email in error, please notify the sender immediately and delete this email. If you are not the intended recipient(s), you must not use, retain or disclose any information contained in this email. Any views or opinions are solely those of the sender and do not necessarily represent those of Bangor University. Bangor University does not guarantee that this email or any attachments are free from viruses or 100% secure. Unless expressly stated in the body of the text of the email, this email is not intended to form a binding contract - a list of authorised signatories is available from the Bangor University Finance Office. www.bangor.ac.uk ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ mitk-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mitk-users
