Giter VIP home page Giter VIP logo

Comments (6)

tomdoel avatar tomdoel commented on July 17, 2024

Hi Hari,

PTK automatically crops the image to what it thinks is the lung region of interest (ROI). However, it determines this by segmenting the lung using an air threshold and region growing. If there's a lot of disease it may not detect the whole lung and will crop out too much.

You can switch PTK into "full image" display by selecting "Full Image" as the Context on the Plugins screen (in the codebase this is called the 'Original Image' Context).

Note this doesn't change the way any of the algorithms operate, it just shows the results on top of the full image rather than the cropped ROI. If the segmentation algorithms are failing, this won't fix them; it would need changes to the ROI detection algorithm (see PTKGetLungROIForCT.m).

from pulmonarytoolkit.

haribalankumar avatar haribalankumar commented on July 17, 2024

Thanks Tom, That issue is fixed!.
When i segment the image and manually corrected them, i export them to jpeg files.
As soon as I do that, the masks get cropped off at left and right boundary as seen in this snapshot. The exported masks also have this trimming. Not sure why this might happen.
PTK_edge_croppingissue

from pulmonarytoolkit.

tomdoel avatar tomdoel commented on July 17, 2024

I think it's the same reason as before - the Lung Region of Interest (Lung ROI) is wrong. I don't think there's a simple solution in the UI - it would require some programming.

Lung segmentations (and any manual corrections to them) are cropped to the Lung ROI "Context" so if the Lung ROI misses out parts of the lung then the segmentations will be cropped too.

The Lung ROI is determined by the algorithm in PTKGetLungROIForCT.m (which calls PTKSegmentLungsWithoutClosing.m). It should include the whole lung region, but in this case it's not detecting all of the lung because of disease. You can in theory manually correct the LungROI (because you can manually correct any plugin result in PTK) but there is no tool for this in the UI so it would have to be done with the Matlab programming API.

So to fix it would require either:

a) modifying the above algorithm files to improve the ROI detection (note to stop PTK using previous cached results you need to increase the Version property in the PTKLungROI.m every time you modify the algorithms); or

b) applying a manual correction to the LungROI plugin results (this can't be done via the UI but could be done in Matlab but requires you to understand how to save manual corrections via the PTK API)

from pulmonarytoolkit.

jakublaznovsky avatar jakublaznovsky commented on July 17, 2024

Hello,
I have encountered the same issue with the cropping image. I'd like to switch PTK into "full image" display mode, but in gui there is no button for that. I suppose that I need to switch PTK to developer mode, to see a Plugins screen. How can I do it, please?
Thank you in advance.

from pulmonarytoolkit.

tomdoel avatar tomdoel commented on July 17, 2024

Hi @jakublaznovsky. Developer mode is enabled by clicking the "Show dev tools" button on the toolbar at the bottom.

However, this won't fix your issue if you're planning to use any of the lung segmentation or analysis tools. PTK crops the image to the lung context, determined by the LungROI algorithm. So if the image is being cropped inside the lung boundary, it means the LungROI plugin does not work with your data. You'd need to modify or replace the LungROI algrorithm with your own that is designed for your data.

Switching to "full image" mode does not change the region used by the lung segmentation and analysis algorithms. All it does is display the results on the full image. The algorithms still operate on the LungROI context, so if that is wrong the algorithms may not produce the correct results.

from pulmonarytoolkit.

haribalankumar avatar haribalankumar commented on July 17, 2024

This is a quick fix:

  1. Run segment lung (segment tab lungs button)

  2. Correct the boundary and save edits

  3. Segment the lung again.

  4. Find PTKGetLungROIForCT.m comment line 47 which is
    reduced_image = PTKSegmentLungsWithoutClosing(reduced_image, false, true, false, reporting); Segment the lung again, manually correct the segment, save edits. and segment the lung

The 4th step skipped the cropping process and can save this mask from here.
This is just a temporary fix I think - need to uncomment it back if you want to do other operations.

from pulmonarytoolkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.