[Insight-users] ITK + QT
Ken Urish
ken.urish at gmail.com
Tue Apr 29 04:54:02 EDT 2008
Miroslav
The easiest way to connect ITK and QT is by having QT do a process
call using the QProcess. Write your ITK exe that has your arguments.
Qt collects your input parameters, and then creates a process object
that will call the ITK executable along with the additional arguments.
There are some ways to have a little more interaction, but if you dont
have alot of C++ or ITK experience this is the fastest way to be up
and running. This is also very nice for debugging because it keeps Qt
and ITK seperate. After this is working you can make both more
integrated.
Code would look like this:
void MainWindow::runITK()
{
QString inputFileName;
QString outputFileName;
int someInputParameter;
process = new QProcess(this);
process->addArgument ("ITKprogram.exe");
process->addArgument (inputFileName);
process->addArgument (outputFileName);
process->addArgument (someInputParameter);
//line below is a signal/slot for when itk is finished to
//do next step of MainWindow::ProcessExited()
connect (process, SIGNAL (processExited()), this, SLOT processExited()00;
process->start();
}
Message: 2
Date: Mon, 28 Apr 2008 20:41:46 +0300
From: "Miroslav Levkovec" <mirrkaz at gmail.com>
Subject: [Insight-users] ITK + QT
To: insight-users at itk.org
Message-ID:
<bee7df790804281041p6003a770qe85f0a311548a96b at mail.gmail.com>
Content-Type: text/plain; charset="utf-8"
Hi guys,
I'm new one in ITK, and I'm not very good in C/C++(but have some
experience).
Could You explain me, how to connect ITK with QT. I'm trying to write a
simple program with user interface, where you can read a DICOM, and write it
into png.
Thank You!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-users/attachments/20080428/1aa951c4/attachment-0001.htm>
On 4/29/08, insight-users-request at itk.org <insight-users-request at itk.org> wrote:
> Send Insight-users mailing list submissions to
> insight-users at itk.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://www.itk.org/mailman/listinfo/insight-users
> or, via email, send a message with subject or body 'help' to
> insight-users-request at itk.org
>
> You can reach the person managing the list at
> insight-users-owner at itk.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Insight-users digest..."
>
>
> Today's Topics:
>
> 1. Re: Subtracting Images - A Possible Pixel-Type Issue (Luis Ibanez)
> 2. ITK + QT (Miroslav Levkovec)
> 3. some questions with the ThinPlateSplineWarp.cxx (feng yang)
> 4. Re: Poor Tree Trace Interface (Kevin H. Hobbs)
> 5. Neuroimaging positions in Australia (Olivier.Salvado at csiro.au)
> 6. Problems building ITK-Snap outside the Insight Applications
> tree (Vries, J de)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 28 Apr 2008 12:07:57 -0400
> From: Luis Ibanez <luis.ibanez at kitware.com>
> Subject: Re: [Insight-users] Subtracting Images - A Possible
> Pixel-Type Issue
> To: "M. Wirtzfeld" <wirtzfeld at rogers.com>
> Cc: insight-users at itk.org
> Message-ID: <4815F65D.8030305 at kitware.com>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>
> Hi Michael,
>
> Thanks for the detailed description of the problem.
>
> By looking at the code of the Functor in the
> itkSquaredDifferenceImageFilter:
>
> inline TOutput operator()( const TInput1 & A,
> const TInput2 & B)
> {
> const double dA = static_cast<double>( A );
> const double dB = static_cast<double>( B );
> const double diff = dA - dB;
> return static_cast<TOutput>( diff * diff );
> }
>
>
> The only way this can generate negative values
> is by overflow in the range of the TOutput=short
> type.
>
> You probably have in your images difference that
> are large enough to overflow a short when the
> values are put to the square. Eg. A short overflows
> at "32767", which means that a difference of "181"
> (when elevated to the square) is enough to saturate
> the output and to roll over to the negative range.
>
> For example, if the difference between the pixel
> values of two images is = 183, then its square
> will be: 33493, and when stored in a signed short
> it will become = 33493-32767 = -721.
>
> ------
>
> What you may want to do is to replace this filter
> with the itkAbsoluteValueDifferenceImageFilter,
> whose Functor does:
>
> inline TOutput operator()( const TInput1 & A,
> const TInput2 & B)
> {
> const double dA = static_cast<double>( A );
> const double dB = static_cast<double>( B );
> const double diff = dA - dB;
> const double absdiff = ( diff > 0.0 ) ? diff : -diff;
> return static_cast<TOutput>( absdiff );
> }
>
>
> and therefore will remain in the range of shorts.
>
> Note that if you are out of luck (not to bring
> Murphy's Laws into this discussion... but...)
> you can still saturate a short in this context.
>
> If you have two pixels:
>
> P1 = +20000
> P2 = -20000
>
> which are valid short values,
> their subtraction will be computed incorrectly
> in short:
>
> DP = 40000
>
> will be stored as: 40000-32767 = -7232
>
>
> Which means that if you really care about the
> safety of the filter, you should customize your
> own with some clamping rule such as:
>
> inline TOutput operator()( const TInput1 & A,
> const TInput2 & B)
> {
> const double dA = static_cast<double>( A );
> const double dB = static_cast<double>( B );
> const double diff = dA - dB;
> const double absdiff = ( diff > 0.0 ) ? diff : -diff;
> if( absdiff > itk::NumericTraits<TOutput>::max() )
> {
> absdiff = itk::NumericTraits<TOutput>::max();
> }
> return static_cast<TOutput>( absdiff );
> }
>
>
> You can easily write this filter by editing the
> .h file of either one of the two filters described
> above.
>
> Of course, if you write this new filter, it will
> be great is you submit it as a contribution to the
> Insight Journal:
>
> http://www.insight-journal.org/InsightJournalManager/index.php
>
>
>
>
> Please let us know if you run into any problems,
>
>
> Thanks
>
>
> Luis
>
>
> ------------------
> M. Wirtzfeld wrote:
> >
> > Hello all,
> >
> > I am relative new to ITK, so bare with me...
> >
> >
> > I am working on a registration project and I would like to take the
> > difference between an image slice and a resulting image taken from a
> > volume after registration done. In essence, a pixel-by-pixel subtraction.
> >
> >
> > The itk::SquaredDifferenceImageFilter is currently being used to
> > determine the difference image. However, when pixel-values are reviewed
> > in the resulting image, large negative values are found. It is believed
> > these negative values are due to the use of the SHORT data-type to
> > represent the pixel-type. The squared-operation of the filter obviously
> > handles negative subtraction results; likely to occur regardless of the
> > order in which the two images are given to this filter.
> >
> > Is the use of the SHORT data-type likely responsible for these negative
> > pixel-values? Changing the type is not an option.
> >
> >
> > Reading through the ITK Software Guide (Version 2.4), I came across
> > the itk::SubtractImageFilter topic in Section 8.2, "Hello World"
> > Registration, page 323. In this section it says,
> >
> >
> > "... the use of subtraction as a method for comparing the images is
> > appropriate here because we chose to represent the images using a pixel
> > type float. A different filter would have been used if the pixel type
> > of the images were any of the unsigned integer type."
> >
> >
> >
> > The difference is defined, with reference to respective class
> > documentation, as "Output = Input1 - Input2" for the
> > itk::SubtractImageFilter. With this in mind, and the fact that the
> > pixel-values across the entire image for "Input2" will likely not be
> > less than the respective pixels in "Input1", can I directly apply the
> > itk::SubtractImageFilter in this case?
> >
> >
> >
> > Thank you,
> >
> > Michael.
> > Robarts Research.
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
>
>
> ------------------------------
>
> Message: 2
> Date: Mon, 28 Apr 2008 20:41:46 +0300
> From: "Miroslav Levkovec" <mirrkaz at gmail.com>
> Subject: [Insight-users] ITK + QT
> To: insight-users at itk.org
> Message-ID:
> <bee7df790804281041p6003a770qe85f0a311548a96b at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi guys,
> I'm new one in ITK, and I'm not very good in C/C++(but have some
> experience).
> Could You explain me, how to connect ITK with QT. I'm trying to write a
> simple program with user interface, where you can read a DICOM, and write it
> into png.
> Thank You!
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20080428/1aa951c4/attachment-0001.htm>
>
> ------------------------------
>
> Message: 3
> Date: Mon, 28 Apr 2008 21:19:35 +0200
> From: "feng yang" <yalltroy at gmail.com>
> Subject: [Insight-users] some questions with the
> ThinPlateSplineWarp.cxx
> To: "Luis Ibanez" <luis.ibanez at kitware.com>
> Cc: ITK <Insight-users at itk.org>
> Message-ID:
> <89998d610804281219w1862cef1s59e78ee3ba5a04d5 at mail.gmail.com>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi, Luis,
> I have sent email to the Insight-users list several days ago,but just now
> I search in the mailing list, and there isn't the lettre I have sent.Because
> the attaching files are too big?
>
> My input is just the Landmark of a heart vector field(I have deleted the
> part for reading the input image and get the deformed image in the
> ThinPlateSplineWarp.cxx,because I am not care about it), and the output is
> the deformation field.
> I attached you the input file and the ThinPlateSplineWarp.cxx I used in
> my project. But it failed, so this time I just interpret the input file and
> output file.The input file is the LandMark.txt,which includes original
> coordinates and the terminal coordinates of the deformation.The Landmark
> have located the heart in a local region,so it doesn't have the problem "the
> landmarks are not located in space at the positions that you expect them to
> be with respect to the image."
> In addition, I thought the TPS transform will tend to zero when the
> distance tend to infinity,because for 3D TPS, the sum of the wi*r will be
> wero smaller as the pixel is farther from the original Landmark. But I don't
> think it's true for the 2D TPS, because the sum of the wi*r^2*logr will be
> larger as the pixel is farther from the original Landmark. Is this a bug for
> the 2D TPS?
>
> The best way is to send the landMark.txt and mytps.cxx to you, is there
> any method to do this?(Because the attached files are larger than 40k)
>
> Thanks!
>
> Feng
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20080428/4f81fcc7/attachment-0001.htm>
>
> ------------------------------
>
> Message: 4
> Date: Mon, 28 Apr 2008 16:31:08 -0400
> From: "Kevin H. Hobbs" <hobbsk at ohiou.edu>
> Subject: Re: [Insight-users] Poor Tree Trace Interface
> To: Insight Users List <insight-users at itk.org>
> Message-ID: <1209414668.6559.11.camel at gargon.hooperlab>
> Content-Type: text/plain; charset="us-ascii"
>
> I've made my program much easier to use, mostly by incorporating most of
> the logic into a class and using the UserEvent callback in the VTK
> interactor.
>
> http://crab-lab.zool.ohiou.edu/kevin/Interactive_Trace-0.0.4/
>
> There are still some problems:
> 1) there's some issue with extents after clips.
> 2) it still segfaults
> 3) the stitching of the branch pieces is off
> 4) it should use buttons instead of the silly text menu
>
> On Fri, 2008-04-18 at 08:56 -0400, Kevin H. Hobbs wrote:
> > I've been working on an program for tracing out the center-lines of
> > dendrites in confocal images.
> >
> > I have a working first version at :
> > http://crab-lab.zool.ohiou.edu/kevin/Interactive_Trace-0.0.1/
> >
> > This is a *very* early version it segfaults, it throws exceptions, it's
> > written in a very C like way, it's clunky... but it works.
> >
> > One of the core requirements was that the original image could be huge,
> > and that work could be done on small pieces.
> >
> > It uses vesselness -> fast marching -> gradient -> stream tracing to
> > produce the center-lines.
> >
> > Please give me your comments.
> > _______________________________________________
> > Insight-users mailing list
> > Insight-users at itk.org
> > http://www.itk.org/mailman/listinfo/insight-users
> -------------- next part --------------
> A non-text attachment was scrubbed...
> Name: not available
> Type: application/pgp-signature
> Size: 189 bytes
> Desc: This is a digitally signed message part
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20080428/8e0abc90/attachment-0001.pgp>
>
> ------------------------------
>
> Message: 5
> Date: Tue, 29 Apr 2008 14:05:16 +1000
> From: <Olivier.Salvado at csiro.au>
> Subject: [Insight-users] Neuroimaging positions in Australia
> To: <insight-users at itk.org>
> Message-ID:
> <424C18150E72AC4DB3C52894F1A1A8E70123E80D at exnswn2-syd.nexus.csiro.au>
> Content-Type: text/plain; charset="US-ASCII"
>
> CSIRO ICT centre is seeking to fill several positions at the scientist
> and post-doctoral level to work on neuro-degenerative diseases and brain
> tumour characterization.
>
> The Biomedical Imaging team part of the Australian e-Health Research
> centre is a leading Australian medical imaging research group, with a
> well developed expertise in image registration, extraction of
> quantitative information (shape, volume, texture), morphometry,
> soft-tissue modelling (3D meshing, visual and haptic interaction) and
> data classification. The successful applicants will be involved in
> activities focused on the development and application of novel
> techniques for segmentation, registration and analysis of PET and MR
> images. These positions offer the opportunity to work in a high quality
> research environment, with strong clinical collaboration. The research
> scientists and post-doctoral fellows will join a large team (>20
> scientists, post-doctoral fellows, and students) in an exciting working
> environment ideally located in one of the fastest growing city in
> Australia close to many attractions and beautiful beaches.
>
> More details can be found on the CSIRO career website:
>
> https://recruitment.csiro.au/asp/job_details.asp?RefNo=2008%2F487
>
> https://recruitment.csiro.au/asp/job_details.asp?RefNo=2008%2F9
>
> For further information please contact
>
> Olivier Salvado, PhD
> Team Leader Biomedical Imaging
> Email: mailto:olivier.salvado at csiro.au CSIRO ICT Centre Australian
> e-Health Research Centre (AEHRC)
> Phone: +61 7 3024 1658
> Fax: +61 7 3024 1690
> Mobile: +61 4 0388 2249
> web: http://www.aehrc.net/
>
>
>
>
>
> ------------------------------
>
> Message: 6
> Date: Tue, 29 Apr 2008 09:49:37 +0200
> From: "Vries, J de" <jurgen.de.vries at rad.umcg.nl>
> Subject: [Insight-users] Problems building ITK-Snap outside the
> Insight Applications tree
> To: <insight-users at itk.org>
> Message-ID:
> <F1204FFE7AA6E248A1BC6AB7C732F149040F6E6D at W3ZKHAS05.zkh.umcg.intra>
> Content-Type: text/plain; charset="us-ascii"
>
> Hello,
>
> I was trying to build ITK-Snap outside Insight Applications but i ran
> into trouble. The problems occur when i try to configure Cmake.
> I get an error that says: Cmake error:
> /SNAP/ProgramData/SnapProgramDataDirectory.txt does not exist.
> This error pops up for all the files that are located in the
> /ProgramData directory.
> Some how i get the feeling it has to do with absolute and relative paths
> in CMakeList.txt, that something is wrong in there.
>
> Does anyone know what i am doing wrong? Any help is highly appreciated!
>
> I use the following versions of used software:
> - Visual C++ 2008 Express Edition
> - Cmake 2.4.8
> - ITK 3.4.0
> - Insight Applications 3.4.0
> - VTK 5.0.4
> - FLTK 1.1.7
>
> Jurgen
>
>
> De inhoud van dit bericht is vertrouwelijk en alleen bestemd voor de geadresseerde(n). Anderen dan de geadresseerde(n) mogen geen gebruik maken van dit bericht, het niet openbaar maken of op enige wijze verspreiden of vermenigvuldigen. Het UMCG kan niet aansprakelijk gesteld worden voor een incomplete aankomst of vertraging van dit verzonden bericht.
>
> The contents of this message are confidential and only intended for the eyes of the addressee(s). Others than the addressee(s) are not allowed to use this message, to make it public or to distribute or multiply this message in any way. The UMCG cannot be held responsible for incomplete reception or delay of this transferred message.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://www.itk.org/pipermail/insight-users/attachments/20080429/e5f89d45/attachment.htm>
>
> ------------------------------
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
> End of Insight-users Digest, Vol 48, Issue 80
> *********************************************
>
More information about the Insight-users
mailing list