lungmask | Automated lung segmentation in CT | Computer Vision library
kandi X-RAY | lungmask Summary
kandi X-RAY | lungmask Summary
Automated lung segmentation in CT
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Performs post - processing
- Compute the bounding box of a given labelmap
- Removes the largest connected component
- Preprocess image
- Crop and resizes image
- Generate a simple body mask
- Apply FITS to an image
- Apply a model to an image
- Load a trained model
- Get an image from a file
- Read dicom files
- Perform a forward transformation
- Center the crop of a given layer
lungmask Key Features
lungmask Examples and Code Snippets
Community Discussions
Trending Discussions on lungmask
QUESTION
I'm working on a preprocessing function that takes DICOM files a input and returns a 3D np.array
(image stack). The problem is that I need to keep the association between ImagePositionPatient[2]
and the relative position of the processed images in the output array.
For example, if a slice with ImagePositionPatient[2] == 5
is mapped to a processed slice in position 3 in the returned stack, I need to return another array that has 5
in the third position, and the same for all original slices. For slices created during processing by interpolation or padding, the array shall contain a palceholder value like -99999 instead.
I paste my code here. EDIT: new simplified version
...ANSWER
Answered 2020-Jun-08 at 06:22I will try to give at least some hints to the answer. As has been discussed in the comments, resizing may remove the processed data at the original positions due to needed interpolation - so in the end you have to come up with a solution for that, either by changing the resizing target to a multipe of the actual resolution, or by returning the interpolated positions instead.
The basic idea is to have your positions array z
be transformed the same as the images are in z direction. So for each operation in processing that changes the z location of the processed image, a similar operation has to be done for z.
Let's say you have 5 slices with a slice distance of 3mm:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install lungmask
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page