wynjseu | 25 May 2013 08:01
Picon

AtlasSegmentation

 Hello!
 I am trying to run the AtlasSegmentation code from InsightApplication-1.80/IBSRValidation, but the
programe cannot execute rightly. When the programe execute to "Label image using atlas", it just stop
there and cannot execute any longer. I feel puzzled. Please tell me the reason.
 Thank you!
_____________________________________
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.php

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

Ramón Casero Cañas | 25 May 2013 01:16
Picon
Gravatar

Problem grafting a C++ array as an ImageToImageFilter output

Hi all,

I think there may be some problem with some of the itk::ImageToImageFilter when one tries to graft a C++ array to be used as the filter's output, or at least with the way I do it.

This was kindly reported by Peter Thalmann in [1], and I'm trying to help him. This is a problem that I had also noticed with a couple of other filters.

I have attached a minimal example of a C++ MEX file that creates a function that can be run from Matlab, with the CMake files to compile it. (I have tried this with ITK 4.3.1).

Save everything to directory test, and then build the example from the shell

cd test
mkdir bin
cd bin
cmake ..
make install

To run the example from Matlab,

cd test
% create a test binary square with a little hole
im = zeros(15, 15, 'uint8');
im(3:13, 3:13) = 1;
im(7:8, 7) = 0;
im2 = itk_test(im);

This runs filter itk::VotingBinaryIterativeHoleFillingImageFilter on the image. The program outputs to the Matlab shell both the content of filter->GetOutput(), and the content of the Matlab output array. As we can see, the output is not being saved to the array

Filter result, reading from the filter
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
Filter result, reading from the Matlab output array
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 


But this approach works for other filters. If we choose the Median filter instead: in ItkTestSimpleImFilter.cpp, ucomment

  // typedef itk::MedianImageFilter<ImageType, ImageType>
  //   FilterType;

and comment out

  typedef itk::VotingBinaryIterativeHoleFillingImageFilter<ImageType>
    FilterType;

[...]

  // filter parameters only for the VotingBinaryIterativeHoleFillingImageFilter
  filter->SetMaximumNumberOfIterations(4);
  filter->SetBackgroundValue(0);
  filter->SetForegroundValue(1);
  filter->SetMajorityThreshold(2);

then we can see that the array is actually being used as the filter's output

>> im2 = itk_test(im);
Filter result, reading from the filter
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
Filter result, reading from the Matlab output array
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 1 1 1 1 1 1 1 1 1 1 1 0 0 
0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 

I have been looking at itkVotingBinaryIterativeHoleFillingImageFilter.hxx, and I was wondering whether the problem is in VotingBinaryIterativeHoleFillingImageFilter< TInputImage >
::GenerateData().

The filter works iteratively, doing

  while ( m_CurrentNumberOfIterations < m_MaximumNumberOfIterations )
    {
    filter->SetInput(input);
    filter->Update();

    m_CurrentNumberOfIterations++;
    progress.CompletedPixel();   // not really a pixel but an iteration
    this->InvokeEvent( IterationEvent() );

    const unsigned int numberOfPixelsChangedInThisIteration =
      filter->GetNumberOfPixelsChanged();
    m_NumberOfPixelsChanged += numberOfPixelsChangedInThisIteration;

    output = filter->GetOutput();
    output->DisconnectPipeline();
    input = output;
    if ( numberOfPixelsChangedInThisIteration == 0 )
      {
      break;
      }
    }
  this->GraftOutput(output);


Here, output gets a DisconnectPipeline(). I have tried commenting that like out, rebuilding and reinstalling ITK, but it doesn't seem to make a difference.


Best regards,

Ramon.




--
Dr. Ramón Casero Cañas

Oxford e-Research Centre (OeRC)
University of Oxford
7 Keble Rd
Oxford OX1 3QG

tlf     +44 (0) 1865 610739
web     http://www.cs.ox.ac.uk/people/Ramon.CaseroCanas
photos  http://www.flickr.com/photos/rcasero/
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

# Find Matlab
SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})
FIND_PACKAGE(Matlab REQUIRED)
IF(MATLAB_FOUND)
  MESSAGE(STATUS "Matlab found")
ELSE(MATLAB_FOUND)
  MESSAGE(FATAL_ERROR "Matlab not found")
ENDIF(MATLAB_FOUND)

# some versions of Matlab or some libraries are not compatible with
# more advanced gcc versions
#
# the compiler version has to be set up before project(), otherwise we
# will get an infinite loop. We force the compiler version setting the
# corresponding environmental variables (equivalent to running e.g.  
# $ CC=gcc-4.4 CXX=g++-4.4 cmake ..  This is a better way than directly
# setting MAKE_C_COMPILER, CMAKE_CXX_COMPILER. For example, if we set these
# variables after project(), this creates an infinite loop.
if(NOT WIN32)
  if(BUILD_WITH_CUDA OR ${MATLAB_VERSION} MATCHES "R2012a")
    set(ENV{CC} gcc-4.4)
    set(ENV{CXX} g++-4.4)
  endif(BUILD_WITH_CUDA OR ${MATLAB_VERSION} MATCHES "R2012a")
endif(NOT WIN32)

PROJECT(ITKTEST)

# Find ITK.
FIND_PACKAGE(ITK REQUIRED)
IF(ITK_FOUND)
  MESSAGE(STATUS "ITK found")
  INCLUDE(${ITK_USE_FILE})
ELSE(ITK_FOUND)
  MESSAGE(FATAL_ERROR "ITK not found")
ENDIF(ITK_FOUND)

INCLUDE_DIRECTORIES(${MATLAB_INCLUDE_DIR})

# Add macros to build MEX files
INCLUDE(${CMAKE_CURRENT_SOURCE_DIR}/MatlabMakeMacros.cmake)

IF(NOT WIN32)
  ADD_DEFINITIONS("-O2 -Wall")
ENDIF(NOT WIN32)

ADD_MEX_FILE(itk_test
  ItkTestSimpleImFilter.cpp)

TARGET_LINK_LIBRARIES(itk_test
  ${ITK_LIBRARIES})

IF(WIN32)
  INSTALL(TARGETS
    itk_test
    RUNTIME
    DESTINATION ${CMAKE_CURRENT_SOURCE_DIR})
ELSE(WIN32)
  INSTALL(TARGETS
    itk_test
    LIBRARY
    DESTINATION ${CMAKE_CURRENT_SOURCE_DIR})
ENDIF(WIN32)
Attachment (FindMatlab.cmake): application/octet-stream, 7649 bytes
Attachment (ItkTestSimpleImFilter.cpp): text/x-c++src, 5256 bytes
Attachment (MatlabMakeMacros.cmake): application/octet-stream, 8 KiB
_____________________________________
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.php

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
Zarko | 24 May 2013 16:57
Favicon

ITK Apps - How to create 3D image ???

Few of ITK Apps such as Fast Marching Segmentation Level Set requires as
input 3 D image with at least 10 pixel in all dimensions. Is there in ITK
examples, ITK tests or in ITKApps some solution which can be used to convert
set of images, dicoms, into one 3D image that i can further use in ITKApps
???

Regards

Z

--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/ITK-Apps-How-to-create-3D-image-tp7583160.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.php

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

chasank | 24 May 2013 11:02
Picon

RGBImageType to FloatImageType wit CastImageFilter

Hi,

I'm reading a JPEG Image and trying to process a blur filter
(BinomialBlurImageFilter) on it. Because BinomialBlurImageFilter does not
accept RGBImageType, first I'm trying to convert the RGBImageType to
FloatImageType however I'm getting compiling errors; The sample code is
below; What conversion should I do for processing a RGB Image ?

typedef itk::Image< itk::RGBPixel <unsigned char>,  2 >  RGBImageType;
typedef itk::Image< float, 2 >                                      
FloatImageType;

        itk::VTKImageToImageFilter< RGBImageType >::Pointer converter =
                itk::VTKImageToImageFilter<RGBImageType> :: New();
        converter->SetInput(this->image);
        converter->Update();

        itk::CastImageFilter<RGBImageType, FloatImageType>::Pointer caster =
                itk::CastImageFilter<RGBImageType, FloatImageType>::New();
        caster->SetInput(converter->GetOutput());
        caster->Update();

        itk::BinomialBlurImageFilter< FloatImageType, FloatImageType >
::Pointer blurFilter =
                itk::BinomialBlurImageFilter < FloatImageType,
FloatImageType> ::New();
        blurFilter->SetInput( caster->GetOutput() );
        blurFilter->SetRepetitions(2);
        blurFilter->Update();

        itk::CastImageFilter<FloatImageType, RGBImageType>::Pointer caster2
=
                itk::CastImageFilter<FloatImageType, RGBImageType>::New();
        caster2->SetInput(blurFilter->GetOutput());
        caster2->Update();

/usr/local/include/ITK-4.3/itkConceptChecking.h: In member function 'void
itk::Concept::Convertible<T1, T2>::Constraints::constraints() [with T1 =
itk::RGBPixel<unsigned char>, T2 = float]':
/usr/local/include/ITK-4.3/itkConceptChecking.h:192:   instantiated from
'itk::Concept::Convertible<itk::RGBPixel&lt;unsigned char>, float>'
/usr/local/include/ITK-4.3/itkCastImageFilter.h:116:   instantiated from
'itk::CastImageFilter<itk::Image&lt;itk::RGBPixel&lt;unsigned char>, 2u>,
itk::Image<float, 2u> >'
../Program/program.cpp:67:   instantiated from here
/usr/local/include/ITK-4.3/itkConceptChecking.h:185: error: invalid
static_cast from type 'itk::RGBPixel<unsigned char>' to type 'float'
/usr/local/include/ITK-4.3/itkCastImageFilter.h: In member function 'TOutput
itk::Functor::Cast<TInput, TOutput>::operator()(const TInput&) const [with
TInput = itk::RGBPixel<unsigned char>, TOutput = float]':
/usr/local/include/ITK-4.3/itkUnaryFunctorImageFilter.hxx:175:  
instantiated from 'void itk::UnaryFunctorImageFilter<TInputImage,
TOutputImage, TFunction>::ThreadedGenerateData(const typename
TOutputImage::RegionType&, itk::ThreadIdType) [with TInputImage =
itk::Image<itk::RGBPixel&lt;unsigned char>, 2u>, TOutputImage =
itk::Image<float, 2u>, TFunction =
itk::Functor::Cast<itk::RGBPixel&lt;unsigned char>, float>]'
../Program/program.cpp:151:   instantiated from here
/usr/local/include/ITK-4.3/itkCastImageFilter.h:83: error: invalid
static_cast from type 'const itk::RGBPixel<unsigned char>' to type 'float'

--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/RGBImageType-to-FloatImageType-wit-CastImageFilter-tp7583155.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.php

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

Cary lorey | 23 May 2013 01:28
Picon

Bad crop with mouse click

Hello,

I am trying to retrieve the values of a pixel from a mouse clicks and I pass the x and y parameters to the crop function , but when I click on the image , the application crashes. here is my code:

class MouseInteractorStyle3 : public vtkInteractorStyleTrackballCamera
{
  public:
    static MouseInteractorStyle3* New();

    virtual void OnLeftButtonDown() 
    {
typedef itk::Image<unsigned short,2> ImageType;


      std::cout << "Pressed left mouse button." << std::endl;
      int x = this->Interactor->GetEventPosition()[0];
      int y = this->Interactor->GetEventPosition()[1];

      vtkSmartPointer<vtkCoordinate> coordinate = 
        vtkSmartPointer<vtkCoordinate>::New();
      coordinate->SetCoordinateSystemToDisplay();
      coordinate->SetValue(x,y,0);
 
 
 
      // This doesn't produce the right value if the sphere is zoomed in???
      double* world = coordinate->GetComputedWorldValue(this->Interactor->GetRenderWindow()->GetRenderers()->GetFirstRenderer());
      std::cout << "World coordinate: " << world[0] << ", " << world[1] << ", " << world[2] << std::endl;
 Crop(x,y);
      // Forward events
      vtkInteractorStyleTrackballCamera::OnLeftButtonDown();
 
    }
void Crop(int x, int y){
typedef itk::Image<unsigned short,2> ImageType;
typedef itk::ImageFileReader<ImageType> ReaderType;
typedef itk::ImageToVTKImageFilter<ImageType> ConnectorType;
ReaderType::Pointer reader= ReaderType::New();
ConnectorType::Pointer Connector= ConnectorType::New();

ImageType::Pointer image = ImageType::New();
  ImageType::SizeType cropSize;

reader->SetFileName("C:/Test.jpg");
reader->Update();
 
image = reader->GetOutput();
    cropSize[0] = x;
    cropSize[1] = y;
typedef itk::CropImageFilter <ImageType, ImageType>
    CropImageFilterType;
 
  CropImageFilterType::Pointer cropFilter
    = CropImageFilterType::New();
  cropFilter->SetInput(image);
  cropFilter->SetBoundaryCropSize(cropSize);
  cropFilter->Update();

typedef itk::FlipImageFilter< ImageType >   FlipImageFilterType;

FlipImageFilterType::Pointer flipFilter = FlipImageFilterType::New ();
 // flipFilter->SetInput( reader->GetOutput() );
  flipFilter->SetInput( cropFilter->GetOutput() );

  bool flipAxes[3] = { false, true, false };
flipFilter->SetFlipAxes(flipAxes);
flipFilter->Update();

Connector->SetInput( flipFilter->GetOutput() );
vtkImageViewer* viewer= vtkImageViewer::New();

vtkRenderWindowInteractor* renderWindowInteractor = vtkRenderWindowInteractor::New();
viewer->SetupInteractor( renderWindowInteractor);
viewer->SetInput( Connector->GetOutput() );
viewer->Render();
viewer->SetColorWindow( 255);
viewer->SetColorLevel(128);
renderWindowInteractor->Start();
}
 
};
 
vtkStandardNewMacro(MouseInteractorStyle3);



I spent a lot temp to seek a solution to a crop with mouse manipulation, I tried to find a solution that unfortunately contains a bug, I count on you to help me, I really need your help.

Please answer me!!
thank you


_____________________________________
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.php

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
Cary lorey | 22 May 2013 18:33
Picon

Example with startPickEvent

Hello,

I am a beginner in ITK, please can you help me with an example that uses startPickEvent , I read the documentation but is not clear.

thank you in advance.
_____________________________________
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.php

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
gib | 22 May 2013 07:04
Picon
Picon
Favicon

Peel an image

It's hard to know what to call the processing I want to apply.  I have a set
of biological images (actually a 3D image, but for now I'm happy to process
the frames one-by-one) in which the region of interest has an irregular and
incomplete labelled layer around the boundary.  The staining of the layer
was unintended, and its presence interferes with the segmentation that I am
doing.  The part of the image that I want to extract is made up of many
disconnected objects, and there is not much difference in the intensity
ranges of the objects of interest and the unwanted edge.  I am willing to
trim a few pixels off the boundary all the way around - this will not cause
much loss of information.  What I need is way to determine a sequence of
pixels that in some sense defines the extent of the labelled region in the
image, rather like a 2D shrink wrapping.  I could then use this to shave or
peel off the outer layer of pixels.

Does this process have a name?  Are there any existing filters or code to do
this?  Any clever suggestions (I have some ideas)?

Thanks
Gib

--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Peel-an-image-tp7583137.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.php

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 Fuentes | 21 May 2013 22:26
Picon

PBNRR CreateDeformedImage


Hi,

What was the purpose of the CreateDeformedImage Method for the PBNRR class  ?


Is this code functionally different than using the WarpImageFilter to apply the output deformation field to the moving image ?

Thanks,
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.php

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
Thomas Deschamps | 21 May 2013 08:35
Favicon

itk/simpleitk differences for ReconstructionByDilationImageFilter marker/mask inputs?

Hi

In ITK ReconstructionByDilationImageFilter it's specifically written in the documentation that The marker image must be less than or equal to the mask image (on a pixel by pixel basis).
But in SimpleITK I get the following error message with sitk.ReconstructionByDilationImageFilter:

itk::ERROR: ReconstructionByDilationImageFilter(0x7fd6fc671ea0): Marker pixels must be >= mask pixels.

So either the message means that some marker pixels have been found to be >= to mask pixels, or another convention as been chosen. Does anybody know the answer?

BTW, it is clearly not indicated in the documentation which image is the marker image and which one is the mask image. Is this documented anywhere?

Thanks for your help.

TD.

_____________________________________
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.php

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
Luke Bloy | 20 May 2013 22:19
Picon

Choosing points randomly from a mask

Hi All,

 

I am interested in randomly choosing locations from within a mask. Currently my mask is stored as a SpatialObject but I could change this if needed. My current plan is to

 

1)      Get the bounding box of the spatial object.

2)      Call vnl_sample_uniform for x,y and z

3)      Repeat 2 until the point is inside the spatial Object

 

Does anyone have any better ideas on how to go about this. Has this been implemented somewhere else within ITK?

 

Thanks,

Luke

 

_____________________________________
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.php

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
Cary lorey | 20 May 2013 20:08
Picon

How to handle x, y, w and h of a rectangle with the mouse with vtk?

Hello,

I use vtkContext2D class to draw a rectangle, I want to draw the rectangle with the mouse ( not pass the parameters(x,y,w,h) in the code) and retrieve each change the new coordinates (x, y) as well as the length and width of the rectangle to redraw.

Can you help me please!

thank you in advance.

_____________________________________
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.php

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