Nick Rubert | 1 Oct 2011 03:20
Picon

Point selection GUI

Hello mailing list,

I was looking to do the following task in as few lines of code as possible.  I was hoping someone could point me to a good example.

I want to display an image in a viewer.   (preferably a Qt based GUI)
Select a point with a mouse click
Use the coordinates of the point as a seed in a segmentation algorithm.

If anyone could point me to a good example I would appreciate it.

Thanks,

Nick

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Matt McCormick | 1 Oct 2011 14:11
Favicon

Re: MICCAI tutorial for ITKv4, SimpleITK

Direct download is now available, too.  This files can be found here:

http://midas.kitware.com/community/view/22

Thanks,
Matt

On Sat, Sep 24, 2011 at 5:36 PM, Matt McCormick
<matt.mccormick@...> wrote:
> Hi,
>
> It was a pleasure to meet with many from the ITK community at the
> MICCAI conference in Toronto.
>
> For those not present, two tutorials where given on ITKv4 and
> SimpleITK.  All content was distributed as VirtualBox virtual
> machines.  These can be downloaded from:
>
> http://linuxtracker.org/download.php?id=6c3029cbab58dcf7696e6d9d8755d7b11f2713b3&f=miccai_2011_itkv4_tutorial_vm.torrent
> http://linuxtracker.org/download.php?id=0e872726cc56db56bf0bbb7db11b6e670fa73e53&f=miccai_2011_simpleitk_tutorial_vm.torrent
>
> Matt
>
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users

Luis Ibanez | 1 Oct 2011 18:56
Favicon
Gravatar

Princeton to Journals: Copyright Transfer No More

Princeton to Journals: Copyright Transfer No More 

http://www.kitware.com/blog/home/post/172

Princeton University has decided that Faculty will
no longer transfer copyright of Papers to Journals.

 

The detailed report from the University can be found here:

http://www.cs.princeton.edu/~appel/open-access-report.pdf 

 

Remarkable excerpts:

"In late 2010 the Dean of the Faculty appointed an ad-hoc faculty committee, comprising professors from all the divisions of the University, to study the question of open-access to faculty publications. The committee met several times in February and March 2011 and adopted this policy and report by unanimous vote."

... 

"We recommend a revision to the Rules and Procedures of the Faculty that will give the University a nonexclusive right to make available copies of scholarly articles written by its faculty, unless a professor specifically requests a waiver for particular articles. The University authorizes professors to post copies of their articles on their own web sites or on University web sites, or in other not-for-a-fee venues. Of course, the faculty already had exclusive rights in the scholarly articles they write; the main effect of this new policy is to prevent them from giving away all their rights when they publish in a journal."

 

Close to the Autumn Equinox,
the Recommendation became Policy:

"The Faculty at its meeting of September 19, 2011 unanimously adopted this open-access policy into the Rules and Procedures of the Faculty of Princeton University."

"The members of the Faculty of Princeton University strive to make their publications openly accessible to the public. To that end, each Faculty member hereby grants to The Trustees of Princeton University a nonexclusive, irrevocable, worldwide license to exercise any and all copyrights in his or her scholarly articles published in any medium, whether now known or later invented, provided the articles are not sold by the University for a profit, and to authorize others to do the same."

 ...

"The University hereby authorizes each member of the faculty to exercise any and all copyrights in his or her scholarly articles that are subject to the terms and conditions of the grant set forth above. This authorization is irrevocable, non-assignable, and may be amended by written agreement in the interest of further protecting and promoting the spirit of open access."

 

The report also includes the realization that in today's Internet age, the web site of the University is as good, if not better, than the web site of the publisher, but with the added advantage that the University is committed to maximizing the public dissemination of the publications. Therefore, a University repository is called for:

"The committee recommends the creation of a University ‘repository’, types of which exist at peer institutions, that will facilitate these goals. The repository would also be available to provide links to the other posting/retrieval systems in use in other fields. Besides serving the aim of open-access, the repository will also offer a picture of the range of scholarship in the University at large."

 

The Princeton Faculty arrives to this policy based on solid principles:

  • The principle of open access is consistent with the fundamental purposes of scholarship.
  • University support (tangible and intangible) for open access is consistent with other forms of university support for scholarship.
  • The primary agents of open access are the faculty; university support for open access is a form of service to the faculty intended to expand the beneficiaries of the university’s research mission.
  • A university policy on open access should recognize and respect the diversity and dynamism of disciplines, professional organizations and academic publishing—maintaining communication, flexibility and diversity as core principles of implementation.
  • Implementing a university-wide open access policy entails ongoing outreach to departments and faculty, involving the participation of chairs, managers and IT specialists—particularly in units where open access is not now the norm.

 

It is a new Era !

Just as Peter Murray predicted recently in his blog 

http://blogs.ch.cam.ac.uk/pmr/2011/07/09/what-is-wrong-with-scientific-publishing-and-can-we-put-it-right-before-it-is-too-late/

It was just a matter of time for an awakening of the academic community to happen, and for all to realize that the Internet has changed everything. The educational mission of academic institutions is not well served by the closed gates of Journal whose business models use copyright as a mechanism for restricting the public's access to information. 

 

The point is nicely made by Larry Lessig:

http://vimeo.com/23078677

This is an edited version of Lawrence Lessig's Lecture at CERN, Geneva, Switzerland, 18 April 2011. This lecture is released as a Creative Commons Attribution license. 

 

and in a funnier way,
the same point is made by Alex O. Holcombe in
"Scientist meets Publisher: The Video" 

http://theconversation.edu.au/scientist-meets-publisher-the-video-3520

http://www.youtube.com/watch?v=GMIY_4t-DR0

 

The Princeton decision, follows the Harvard Faculty decision to 

"...grant to the university a non-exclusive, irrevocable,
     worldwide license to distribute their scholarly articles,
     provided it is for non commercial uses...."

http://cyber.law.harvard.edu/node/3462

 

As well as the creation of a Compact to support Open Access:

http://hul.harvard.edu/news/2009_0914_compact.html

  • Cornell
  • Dartmouth
  • Harvard
  • MIT
  • UC Berkeley
 
This is all a great Prelude to the Upcoming Celebration of the Open Access Week:
  • http://www.openaccessweek.org/
     
  • Join us during  October 24-20, 2011 to celebrate
    the Renaissance of the academic field that raises 
    to Embrace Openness in all its forms.


_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
barbababa | 1 Oct 2011 21:25
Picon

vs net 2003 does not build


Hello!

Does anyone has any experience with building ITK with visual studio NET
2003?

It gives me errors:

itkvnl error C3861: 'ptrdiff_t': identifier not found, even with
argument-dependent lookup
itkvnl error C2146: syntax error : missing ';' before identifier
'difference_type'
itkvnl error C2501: 'std::iterator_traits<_Ty*>::difference_type' : missing
storage-class or type specifiers
itkvnl error C2146: syntax error : missing ';' before identifier
'difference_type'
        C:\Program Files (x86)\Microsoft Visual Studio .NET
2003\Vc7\include\xutility(126) : see reference to class template
instantiation 'std::iterator_traits<const _Ty*>' being compiled
itkvnl error C2501: 'std::iterator_traits<const _Ty*>::difference_type' :
missing storage-class or type specifiers
itkvnl error C2065: 'ptrdiff_t' : undeclared identifier
itkvnl error C2146: syntax error : missing ';' before identifier '_Num1'
itkvnl error C2065: '_Num1' : undeclared identifier
itkvnl error C2146: syntax error : missing ';' before identifier '_Num2'

--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/vs-net-2003-does-not-build-tp6851243p6851243.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users

Dean Inglis | 1 Oct 2011 21:46
Picon

pointset to image registration tuning

I am registering a set of (19) points obtained from a touch probe on
a subject's face.  I have a 3D CT scan of the subject's head that I have
processed into a cost image by the following sequence:
1) ImageFileReader - read in an unsigned short 3D CT image (background has 
value 0)
2) ShrinkImageFilter - shrink all dimensions by a factor of 2
3) ImageRegionConstIteratorWithIndex - find the first pixel index that has a 
value of 0
4) ConfidenceConnectedImageFilter - threshold to unsigned char using the 
seed from 3)
5) SliceBySliceImageFilter / BinaryFillholeImageFilter - fill all holes 
slice by slice with a value of 0
- now there is an image of the background (255) with the entire region 
within the surface of the
subject set to 0, sinuses and ear canals etc removed
6) GradientMagnitudeRecursiveGaussianImageFilter -  generates an image of 
the subject's surface
7) MinimumMaximumImageCalculator  - find the maximum gradient magnitude 
corresponding to strong edges
8) IntensityWindowingImageFilter - rescale the gradient magnitude image to 
0 - 255
9) CastImageFilter - cast to unsigned char

I then have a pointset to image registration pipeline defined in the code 
below.

I have tried setting the transform center to the fixed points center
and an initial translation to the difference between the fixed points and 
center of gravity
of the image.  I have passed in the points both in the original perturbed 
positions (non-registered)
and in a manually registered (using paraview transformation filter) 
configuration.
The pipeline should give a near zero output in the latter case, but does 
not! I seem
to have hit a wall on tuning the optimizer and transform, as no matter what 
I have tried,
(vary step lengths, number of iterations etc) I never get a satisfactory 
(not even close!) registration.
Any insight would be greatly appreciated.

Dean

///////////////////////////////////

  const unsigned int Dimension = 3;
  typedef unsigned char FixedPointDataType;
  typedef itk::PointSet< FixedPointDataType, Dimension > FixedPointSetType;
  FixedPointSetType::Pointer fixedPointSet = FixedPointSetType::New();

  typedef FixedPointSetType::PointsContainer  FixedPointsContainer;
  FixedPointsContainer::Pointer fixedPointContainer  = 
FixedPointsContainer::New();

  typedef FixedPointSetType::PointType FixedPointType;
  FixedPointType fixedPoint;

  // Read the file containing coordinates of fixed points.
  std::ifstream   fixedFile;

  fixedFile.open( argv[1] );
  if( fixedFile.fail() )
  {
    std::cerr << "Error opening points file with name : " << std::endl;
    std::cerr << argv[1] << std::endl;
    return EXIT_FAILURE;
  }

  unsigned int pointId = 0;
  double cx = 0.;
  double cy = 0.;
  double cz = 0.;
  while( !fixedFile.eof() )
  {
    fixedFile >> fixedPoint;
    fixedPointContainer->InsertElement( pointId, fixedPoint );
    std::cout << "point " << pointId << ": " << fixedPoint[0] << ", " << 
fixedPoint[1] << ", " << fixedPoint[2] << std::endl;
    cx += fixedPoint[0];
    cy += fixedPoint[1];
    cz += fixedPoint[2];
    pointId++;
  }
  fixedPointSet->SetPoints( fixedPointContainer );
  int numFixedPts = fixedPointSet->GetNumberOfPoints();
  cx /= numFixedPts;
  cy /= numFixedPts;
  cz /= numFixedPts;
  std::cout << "number of fixed Points = " << numFixedPts << std::endl;

  std::string inputFileName = argv[2];
  // Setup image types
  typedef itk::Image< float,  3 >         FloatImageType;
  typedef itk::Image< unsigned char, 3 >  UnsignedCharImageType;

  // image reader
  // read in the cost image
  //
  typedef itk::ImageFileReader< UnsignedCharImageType > ImageReaderType;
  ImageReaderType::Pointer reader = ImageReaderType::New();
  reader->SetFileName( inputFileName );
  reader->ReleaseDataFlagOff();
  reader->Update();

  std::cout << "image read in " << std::endl;

   FixedPointDataType defaultValue = 128;
  for(int i = 0 ; i < numFixedPts; ++i )
  {
    fixedPointSet->SetPointData( i, defaultValue );
  }

  typedef itk::Vector<double,3>  VectorType;
  typedef itk::ImageMomentsCalculator<UnsignedCharImageType> 
MomentCalculatorType;

    /* Compute the moments */
    MomentCalculatorType::Pointer moments = MomentCalculatorType::New();
    moments->SetImage( reader->GetOutput() );
    moments->Compute();
    moments->Print( std::cout );

    VectorType ccg = moments->GetCenterOfGravity();

    std::cout << "image cofg: " << ccg[0] << ", " << ccg[1] << ", " << 
ccg[2] << std::endl;

  //-----------------------------------------------------------
  // Set up a Transform - does rotation (using versors), adn translation, 
scaling not required
  //-----------------------------------------------------------
  typedef double CoordinateRepresentationType;
  typedef itk::VersorRigid3DTransform< CoordinateRepresentationType   > 
TransformType;
  TransformType::Pointer transform = TransformType::New();
  transform->SetIdentity();

  TransformType::InputPointType centerFixed;
  centerFixed[0] = cx;
  centerFixed[1] = cy;
  centerFixed[2] = cz;
  transform->SetCenter(centerFixed);

  TransformType::OutputVectorType translation;
  translation[0] = ccg[0] - cx;
  translation[1] = ccg[1] - cy;
  translation[2] = ccg[2] - cz;
  transform->SetTranslation( translation );

  //-----------------------------------------------------------
  // Set up Metric (also known as a cost function)
  // must inherit from itkPointSetToImageMetric
  // other options are:
  //  itkMeanReciprocalSquareDifferencePointSetToImageMetric
  //  itkMeanSquaresPointSetToImageMetric
  //  itkNormalizedCorrelationPointSetToImageMetric
  //-----------------------------------------------------------

  typedef itk::MeanReciprocalSquareDifferencePointSetToImageMetric< 
FixedPointSetType, UnsignedCharImageType > MetricType;
  MetricType::Pointer metric = MetricType::New();
  metric->SetLambda( 10 );

  typedef MetricType::TransformType TransformBaseType;
  typedef TransformBaseType::ParametersType ParametersType;

  //------------------------------------------------------------
  // Set up transform parameters - not used
  //------------------------------------------------------------
  /*
    ParametersType parameters( transform->GetNumberOfParameters() );

  //  Versor type
    typedef    TransformType::VersorType      VersorType;
    VersorType versor;

    parameters[0] = versor.GetX();
    parameters[1] = versor.GetY();
    parameters[2] = versor.GetZ();
    parameters[3] = 0.0;             // Translation
    parameters[4] = 0.0;
    parameters[5] = 0.0;
    parameters[6] = 1.0;             // Scale

    transform->SetParameters( parameters );
  */
   //------------------------------------------------------------
  // Set up an Interpolator
  //------------------------------------------------------------
  typedef itk:: NearestNeighborInterpolateImageFunction<
                                    UnsignedCharImageType, 
CoordinateRepresentationType     >    InterpolatorType;
  InterpolatorType::Pointer interpolator = InterpolatorType::New();

  //------------------------------------------------------------
  // Optimizer Type
  //------------------------------------------------------------
  typedef itk::VersorRigid3DTransformOptimizer OptimizerType;
  OptimizerType::Pointer optimizer = OptimizerType::New();

  unsigned long   numberOfIterations =   500;
  double          maximumStepLength  =  1.0;  // no step will be larger than 
this
  double          minimumStepLength  =  0.001; // convergence criterion
  double          gradientTolerance  =  1e-6; // convergence criterion

  // Scale the translation components of the Transform in the Optimizer
  OptimizerType::ScalesType scales( transform->GetNumberOfParameters() );
  scales.Fill( 1.0 );

  // set up the translation scales: translations are much larger than 
rotations
  scales[3] = 1./100.;
  scales[4] = 1./100.;
  scales[5] = 1./100.;

  optimizer->SetScales( scales );
  optimizer->SetNumberOfIterations( numberOfIterations );
  optimizer->SetMinimumStepLength( minimumStepLength );
  optimizer->SetMaximumStepLength( maximumStepLength );
  optimizer->SetGradientMagnitudeTolerance( gradientTolerance );
  optimizer->MinimizeOff();
  optimizer->MaximizeOn();

  typedef IterationCallback< OptimizerType >   IterationCallbackType;
  IterationCallbackType::Pointer callback = IterationCallbackType::New();
  callback->SetOptimizer( optimizer );

  //------------------------------------------------------------
  // registration method
  //------------------------------------------------------------
  typedef itk::PointSetToImageRegistrationMethod< FixedPointSetType, 
UnsignedCharImageType > RegistrationType;
  RegistrationType::Pointer registration = RegistrationType::New();

  //------------------------------------------------------
  // Connect all the components required for Registration
  //------------------------------------------------------
  registration->SetMetric(        metric        );
  registration->SetOptimizer(     optimizer     );
  registration->SetTransform(     transform     );
  registration->SetFixedPointSet( fixedPointSet );
  registration->SetMovingImage(  reader->GetOutput()  );
  registration->SetInterpolator(  interpolator  );
  registration->SetInitialTransformParameters( transform->GetParameters());

  std::cout << "starting registration .. " << std::endl;

  try
    {
    registration->StartRegistration();

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users

Rong Xu | 2 Oct 2011 14:29
Picon

Help for using Canny edge detection in 3D data

Hi,

I am a new man in using ITK library, and I want to realize a edge detection in 3D ultrasound data. However, I read ITK software guide 2.4, and  found it seemed canny edge detection or canny-edge level set segmentation just can used for 2D images. So I am not sure are there any edge detection methods I can use for 3D data? Could you please give me some advice ?

I will appreciate your help! Thank you!

--

---------------------
Best Regards!

===============================================
Rong Xu,  Ph.D Student
Ohya Lab
Graduate School of Global Information and Telecommunication
Studies (GITS), Waseda University
1-6-1 Nishi Waseda, Shinjuku-ku, Tokyo, Japan (ȓ169-8050)

Tel:          +81-80-4208-1207
E-mail:     xurong1981-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
               xurong-xpndHyYk9BFlT6KnxjQfUg@public.gmane.org
===============================================

_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Arnaud Gelas | 2 Oct 2011 21:21
Picon
Favicon

Re: Questions about ITK4

Hi Hui,

The principle of Chan and Vese formulation is to assume there are two parts in your image: background and foreground and each of them are represented by a constant mean value.
In the implementation, we did follow the same principle, e.g. the mean is a scalar if you are working with scalar images, a vector if you are working with vector images, etc.

So, now you want to create a new term / formulation (there might be a specific name for that, but I am not aware of it).
Once you provide the mean image, you need to replace m_Mean by the pixel value for the given input location iP. In your special case, most likely you would only need to change m_Mean by m_MeanImage->GetPixel( iP )

Please, let us know if it works.

Best,
Arnaud

 
On Oct 2, 2011, at 1:55 PM, Hui Tang wrote:

Dear Arnaud,
 
That works!!Thanks!
Now may I ask if my mean intensity is a constant over time but varies in the image, so I will have a mean intensity image, how can I add that to interal term? I know how to get and set image to get the mean intensity image, but in update(), it seems that this->mean can only be a scalar.......
 
Do you have any idea on solve this?
 
thanks,
 
Best,
 
Hui


 
On Fri, Sep 30, 2011 at 3:14 PM, Arnaud Gelas <arnaud_gelas-nES/7uYZTuC+fmr0zi+kZQ@public.gmane.org> wrote:
Hi Hui,

Sorry, there was a typo in my previous email :-/...

Here you go:

    $ git checkout -t origin/v4.0b01

Here are the *.h you are looking for

$ find . | grep itkBinaryImageToWhitakerSparseLevelSetAdaptor.h
./Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToWhitakerSparseLevelSetAdaptor.hxx
./Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToWhitakerSparseLevelSetAdaptor.h

To be able to use the LevelSetsv4, you should either build ITK with all modules, or explicitly turn on the LevelSetsv4 one (which is part of the Segmentation group).

Please keep the conversation on the mailing list, other users may have the same problem.

Best,
Arnaud


On 09/30/2011 09:06 AM, Hui Tang wrote:
Dear Arnaud,
 
Thanks for your help.  I still can not find itkBinaryImageToWhitakerSparseLevelSetAdaptor.h in v4.0b1.
git shows the version number, so it should be right.....
Best,
 
Hui
On Thu, Sep 29, 2011 at 7:05 PM, Hui Tang <tanghui.seu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Hi arnaud thanks a loooooot for this! I will try, I will let you know how it works:) best hui

Op 29 sep. 2011 18:55 schreef "Gelas, Arnaud Joel Florent" <Arnaud_Gelas-nES/7uYZTuC+fmr0zi+kZQ@public.gmane.org> het volgende:

> Hi Hui Tang,
>
> I am really happy to see you are interested and are testing the new level set infrastructure!
>
> If you get this error, I can only assume that you are now using the git master version of ITK, this file has been remove recently from the repository...
> I would strongly recommend to stick to ITK tags, since API keeps on changing all around the place in the toolkit.
>
> Here is how you'd get the last tagged version:
>
> $ git fetch --all
> $ git checkout -t origin/v4.0b1
>
> With this version, you should be able to find itkBinaryImageToWhitakerSparseLevelSetAdaptor.h
>
> If you are more adventurous, and want to be part of the development, you can use master, but expect API / files / class name to change.
> You can also create a gerrit account to review patches (instructions are on the wiki). Note that all contributions / inputs on this effort are welcome!!
>
> Now regarding your question, this is really easy to make it happened in the v4 infrastructure. You have two possibilities:
>
> 1- grab the code from iternal or external term (depending on your case); copy the code; you modify and remove the part in which the mean gets updated.
> and you add itkSetMacro to set the mean at the beginning.
>
> 2- you inherit, might need to change some method to virtual (if needed, let me know that'd be easy to fix).
>
> If you need more details on how to proceed for 1 or 2, just let me know, we can definitively give you some more details on how to proceed.
>
> Thanks,
>
> Best,
> Arnaud
>
> ________________________________________
> From: Hui Tang [tanghui.seu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
> Sent: Thursday, September 29, 2011 12:20 PM
> To: Gelas, Arnaud Joel Florent
> Subject: Questions about ITK4
>
> Dear Arnaud,
>
> How are you?
> I am using ITK4, but this headfile "itkBinaryImageToWhitakerSparseLevelSetAdaptor.h" can not be found in ITK4. Did I do anything wrong?
> And maybe you could help me with another question:) in chanvase model, if my I would like to have a fixed average intensity ("c1") for the foreground how can I implement that using ITK4?
>
> Thanks so much.
>
> Looking forward to your reply.
>
> Best,
>
> Hui Tang




_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Arnaud Gelas | 2 Oct 2011 22:20
Picon
Favicon

Re: Questions about ITK4

Dear Hui,

In ITK3, the "evolution" class inherits from a ProcessObject and you are right this is the typical way to add one more input to a filter, to benefit from ITK's pipeline architecture.

Here, LevelSetEquationChanAndVeseInternalTerm inherits from LevelSetEquationTermBase, which inherits from Object. Thus a term is not a filter, there is no input, no output.
You can also add as many internal members. You can now decide what is going to be inside your term.

You can definitively add another InputImagePointer m_MeanImage.

BTW, are you hacking itkLevelSetEquationChanAndVeseInternalTerm.* ?

Arnaud

On 10/02/2011 04:03 PM, Hui Tang wrote:
Dear Arnaud,
 
thanks for the quick reply!!!
 
Yes you are very right, I need to do that by m_Mean = m_MeanImage->GetPixel( iP ).
 
By the way in ITK3 I used this->ProcessObject::SetNthInput(1,InputImageType* image) to add one more image as input, but in ITK 4, it seems that ProcessObject is not a member function of itkLevelSetEquationChanAndVeseInternalTerm or

LevelSetEquationTermBase.

I guess I can add one more  class member InputImageType* m_MeanImage?

Thanks again for the reply.

 

Best,

 

Hui


Please, let us know if it works.


On Sun, Oct 2, 2011 at 9:21 PM, Arnaud Gelas <Arnaud_Gelas-nES/7uYZTuC+fmr0zi+kZQ@public.gmane.org> wrote:
Hi Hui,

The principle of Chan and Vese formulation is to assume there are two parts in your image: background and foreground and each of them are represented by a constant mean value.
In the implementation, we did follow the same principle, e.g. the mean is a scalar if you are working with scalar images, a vector if you are working with vector images, etc.

So, now you want to create a new term / formulation (there might be a specific name for that, but I am not aware of it).
Once you provide the mean image, you need to replace m_Mean by the pixel value for the given input location iP. In your special case, most likely you would only need to change m_Mean by m_MeanImage->GetPixel( iP )

Please, let us know if it works.

Best,
Arnaud

 
On Oct 2, 2011, at 1:55 PM, Hui Tang wrote:

Dear Arnaud,
 
That works!!Thanks!
Now may I ask if my mean intensity is a constant over time but varies in the image, so I will have a mean intensity image, how can I add that to interal term? I know how to get and set image to get the mean intensity image, but in update(), it seems that this->mean can only be a scalar.......
 
Do you have any idea on solve this?
 
thanks,
 
Best,
 
Hui


 
On Fri, Sep 30, 2011 at 3:14 PM, Arnaud Gelas <arnaud_gelas-nES/7uYZTuC+fmr0zi+kZQ@public.gmane.org> wrote:
Hi Hui,

Sorry, there was a typo in my previous email :-/...

Here you go:

    $ git checkout -t origin/v4.0b01

Here are the *.h you are looking for

$ find . | grep itkBinaryImageToWhitakerSparseLevelSetAdaptor.h
./Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToWhitakerSparseLevelSetAdaptor.hxx
./Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToWhitakerSparseLevelSetAdaptor.h

To be able to use the LevelSetsv4, you should either build ITK with all modules, or explicitly turn on the LevelSetsv4 one (which is part of the Segmentation group).

Please keep the conversation on the mailing list, other users may have the same problem.

Best,
Arnaud


On 09/30/2011 09:06 AM, Hui Tang wrote:
Dear Arnaud,
 
Thanks for your help.  I still can not find itkBinaryImageToWhitakerSparseLevelSetAdaptor.h in v4.0b1.
git shows the version number, so it should be right.....
Best,
 
Hui
On Thu, Sep 29, 2011 at 7:05 PM, Hui Tang <tanghui.seu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Hi arnaud thanks a loooooot for this! I will try, I will let you know how it works:) best hui

Op 29 sep. 2011 18:55 schreef "Gelas, Arnaud Joel Florent" <Arnaud_Gelas-nES/7uYZTuC+fmr0zi+kZQ@public.gmane.org> het volgende:

> Hi Hui Tang,
>
> I am really happy to see you are interested and are testing the new level set infrastructure!
>
> If you get this error, I can only assume that you are now using the git master version of ITK, this file has been remove recently from the repository...
> I would strongly recommend to stick to ITK tags, since API keeps on changing all around the place in the toolkit.
>
> Here is how you'd get the last tagged version:
>
> $ git fetch --all
> $ git checkout -t origin/v4.0b1
>
> With this version, you should be able to find itkBinaryImageToWhitakerSparseLevelSetAdaptor.h
>
> If you are more adventurous, and want to be part of the development, you can use master, but expect API / files / class name to change.
> You can also create a gerrit account to review patches (instructions are on the wiki). Note that all contributions / inputs on this effort are welcome!!
>
> Now regarding your question, this is really easy to make it happened in the v4 infrastructure. You have two possibilities:
>
> 1- grab the code from iternal or external term (depending on your case); copy the code; you modify and remove the part in which the mean gets updated.
> and you add itkSetMacro to set the mean at the beginning.
>
> 2- you inherit, might need to change some method to virtual (if needed, let me know that'd be easy to fix).
>
> If you need more details on how to proceed for 1 or 2, just let me know, we can definitively give you some more details on how to proceed.
>
> Thanks,
>
> Best,
> Arnaud
>
> ________________________________________
> From: Hui Tang [tanghui.seu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
> Sent: Thursday, September 29, 2011 12:20 PM
> To: Gelas, Arnaud Joel Florent
> Subject: Questions about ITK4
>
> Dear Arnaud,
>
> How are you?
> I am using ITK4, but this headfile "itkBinaryImageToWhitakerSparseLevelSetAdaptor.h" can not be found in ITK4. Did I do anything wrong?
> And maybe you could help me with another question:) in chanvase model, if my I would like to have a fixed average intensity ("c1") for the foreground how can I implement that using ITK4?
>
> Thanks so much.
>
> Looking forward to your reply.
>
> Best,
>
> Hui Tang






_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
Arnaud Gelas | 2 Oct 2011 23:38
Picon
Favicon

Re: Questions about ITK4

Hui,

It would be really nice if you could contribute your code to the community via an Insight Journal.

    http://www.insight-journal.org/

You could explain your new term, and show how to use it in one example.

I am sure there are people here who would be interested in such a new functionality, and see how complicated it is to create a new level set term.
It could even end up in ITK4 ;)

Best,
Arnaud


On 10/02/2011 04:20 PM, Arnaud Gelas wrote:
Dear Hui,

In ITK3, the "evolution" class inherits from a ProcessObject and you are right this is the typical way to add one more input to a filter, to benefit from ITK's pipeline architecture.

Here, LevelSetEquationChanAndVeseInternalTerm inherits from LevelSetEquationTermBase, which inherits from Object. Thus a term is not a filter, there is no input, no output.
You can also add as many internal members. You can now decide what is going to be inside your term.

You can definitively add another InputImagePointer m_MeanImage.

BTW, are you hacking itkLevelSetEquationChanAndVeseInternalTerm.* ?

Arnaud

On 10/02/2011 04:03 PM, Hui Tang wrote:
Dear Arnaud,
 
thanks for the quick reply!!!
 
Yes you are very right, I need to do that by m_Mean = m_MeanImage->GetPixel( iP ).
 
By the way in ITK3 I used this->ProcessObject::SetNthInput(1,InputImageType* image) to add one more image as input, but in ITK 4, it seems that ProcessObject is not a member function of itkLevelSetEquationChanAndVeseInternalTerm or

LevelSetEquationTermBase.

I guess I can add one more  class member InputImageType* m_MeanImage?

Thanks again for the reply.

 

Best,

 

Hui


Please, let us know if it works.


On Sun, Oct 2, 2011 at 9:21 PM, Arnaud Gelas <Arnaud_Gelas-nES/7uYZTuC+fmr0zi+kZQ@public.gmane.org> wrote:
Hi Hui,

The principle of Chan and Vese formulation is to assume there are two parts in your image: background and foreground and each of them are represented by a constant mean value.
In the implementation, we did follow the same principle, e.g. the mean is a scalar if you are working with scalar images, a vector if you are working with vector images, etc.

So, now you want to create a new term / formulation (there might be a specific name for that, but I am not aware of it).
Once you provide the mean image, you need to replace m_Mean by the pixel value for the given input location iP. In your special case, most likely you would only need to change m_Mean by m_MeanImage->GetPixel( iP )

Please, let us know if it works.

Best,
Arnaud

 
On Oct 2, 2011, at 1:55 PM, Hui Tang wrote:

Dear Arnaud,
 
That works!!Thanks!
Now may I ask if my mean intensity is a constant over time but varies in the image, so I will have a mean intensity image, how can I add that to interal term? I know how to get and set image to get the mean intensity image, but in update(), it seems that this->mean can only be a scalar.......
 
Do you have any idea on solve this?
 
thanks,
 
Best,
 
Hui


 
On Fri, Sep 30, 2011 at 3:14 PM, Arnaud Gelas <arnaud_gelas-nES/7uYZTuC+fmr0zi+kZQ@public.gmane.org> wrote:
Hi Hui,

Sorry, there was a typo in my previous email :-/...

Here you go:

    $ git checkout -t origin/v4.0b01

Here are the *.h you are looking for

$ find . | grep itkBinaryImageToWhitakerSparseLevelSetAdaptor.h
./Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToWhitakerSparseLevelSetAdaptor.hxx
./Modules/Segmentation/LevelSetsv4/include/itkBinaryImageToWhitakerSparseLevelSetAdaptor.h

To be able to use the LevelSetsv4, you should either build ITK with all modules, or explicitly turn on the LevelSetsv4 one (which is part of the Segmentation group).

Please keep the conversation on the mailing list, other users may have the same problem.

Best,
Arnaud


On 09/30/2011 09:06 AM, Hui Tang wrote:
Dear Arnaud,
 
Thanks for your help.  I still can not find itkBinaryImageToWhitakerSparseLevelSetAdaptor.h in v4.0b1.
git shows the version number, so it should be right.....
Best,
 
Hui
On Thu, Sep 29, 2011 at 7:05 PM, Hui Tang <tanghui.seu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:

Hi arnaud thanks a loooooot for this! I will try, I will let you know how it works:) best hui

Op 29 sep. 2011 18:55 schreef "Gelas, Arnaud Joel Florent" <Arnaud_Gelas-nES/7uYZTuC+fmr0zi+kZQ@public.gmane.org> het volgende:

> Hi Hui Tang,
>
> I am really happy to see you are interested and are testing the new level set infrastructure!
>
> If you get this error, I can only assume that you are now using the git master version of ITK, this file has been remove recently from the repository...
> I would strongly recommend to stick to ITK tags, since API keeps on changing all around the place in the toolkit.
>
> Here is how you'd get the last tagged version:
>
> $ git fetch --all
> $ git checkout -t origin/v4.0b1
>
> With this version, you should be able to find itkBinaryImageToWhitakerSparseLevelSetAdaptor.h
>
> If you are more adventurous, and want to be part of the development, you can use master, but expect API / files / class name to change.
> You can also create a gerrit account to review patches (instructions are on the wiki). Note that all contributions / inputs on this effort are welcome!!
>
> Now regarding your question, this is really easy to make it happened in the v4 infrastructure. You have two possibilities:
>
> 1- grab the code from iternal or external term (depending on your case); copy the code; you modify and remove the part in which the mean gets updated.
> and you add itkSetMacro to set the mean at the beginning.
>
> 2- you inherit, might need to change some method to virtual (if needed, let me know that'd be easy to fix).
>
> If you need more details on how to proceed for 1 or 2, just let me know, we can definitively give you some more details on how to proceed.
>
> Thanks,
>
> Best,
> Arnaud
>
> ________________________________________
> From: Hui Tang [tanghui.seu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org]
> Sent: Thursday, September 29, 2011 12:20 PM
> To: Gelas, Arnaud Joel Florent
> Subject: Questions about ITK4
>
> Dear Arnaud,
>
> How are you?
> I am using ITK4, but this headfile "itkBinaryImageToWhitakerSparseLevelSetAdaptor.h" can not be found in ITK4. Did I do anything wrong?
> And maybe you could help me with another question:) in chanvase model, if my I would like to have a fixed average intensity ("c1") for the foreground how can I implement that using ITK4?
>
> Thanks so much.
>
> Looking forward to your reply.
>
> Best,
>
> Hui Tang







_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users
David Doria | 3 Oct 2011 00:04
Picon
Gravatar

Re: Point selection GUI

On Fri, Sep 30, 2011 at 9:20 PM, Nick Rubert <ncrubert@...> wrote:
> Hello mailing list,
>
> I was looking to do the following task in as few lines of code as possible.
> I was hoping someone could point me to a good example.
>
> I want to display an image in a viewer.   (preferably a Qt based GUI)
> Select a point with a mouse click
> Use the coordinates of the point as a seed in a segmentation algorithm.
>
> If anyone could point me to a good example I would appreciate it.
>
> Thanks,
>
> Nick

Here is one way to do it:

http://www.insight-journal.org/browse/publication/836

David
_____________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Kitware offers ITK Training Courses, for more information visit:
http://www.kitware.com/products/protraining.html

Please keep messages on-topic and check the ITK FAQ at:
http://www.itk.org/Wiki/ITK_FAQ

Follow this link to subscribe/unsubscribe:
http://www.itk.org/mailman/listinfo/insight-users


Gmane