From kanmaniguna at gmail.com Thu May 2 07:09:13 2019 From: kanmaniguna at gmail.com (kanmaniguna) Date: Thu, 2 May 2019 04:09:13 -0700 (MST) Subject: [ITK] [ITK-users] Create STL file from DICOM 2D series of images Message-ID: <1556795353337-0.post@n2.nabble.com> HI I am new to ITK and VTK but i am able to build the ITK and VTK. I have set of 2D DICOM series images around 425. I need to create STL file from dicom 2d images. What are steps are invloved to create STL file from DICOM 2D images. Many Thanks. -- Sent from: http://itk-insight-users.2283740.n2.nabble.com/ The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From dzenanz at gmail.com Thu May 2 10:28:19 2019 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Thu, 2 May 2019 10:28:19 -0400 Subject: [ITK] [ITK-users] Create STL file from DICOM 2D series of images In-Reply-To: <1556795353337-0.post@n2.nabble.com> References: <1556795353337-0.post@n2.nabble.com> Message-ID: Hi, what might better suit your needs is an application which combines them. Slicer has tools to import DICOM, segment the image, and write the result in .stl format. And here is a tutorial for just such a thing: https://discourse.slicer.org/t/new-video-tutorial-for-segment-editor-lumbar-spine-segmentation-for-3d-printing/700 Regards, D?enan On Thu, May 2, 2019 at 7:09 AM kanmaniguna wrote: > HI > > I am new to ITK and VTK but i am able to build the ITK and VTK. > > I have set of 2D DICOM series images around 425. I need to create STL file > from dicom 2d images. > > What are steps are invloved to create STL file from DICOM 2D images. > > Many Thanks. > > > > -- > Sent from: http://itk-insight-users.2283740.n2.nabble.com/ > The ITK community is transitioning from this mailing list to > discourse.itk.org. Please join us there! > ________________________________ > 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: > https://itk.org/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From kanmaniguna at gmail.com Thu May 2 12:25:27 2019 From: kanmaniguna at gmail.com (kanmaniguna) Date: Thu, 2 May 2019 09:25:27 -0700 (MST) Subject: [ITK] [ITK-users] Create STL file from DICOM 2D series of images In-Reply-To: References: <1556795353337-0.post@n2.nabble.com> Message-ID: <1556814327051-0.post@n2.nabble.com> HI This is my college assignment. So i need go with ITK or VTK. Looking forward your reply. -- Sent from: http://itk-insight-users.2283740.n2.nabble.com/ The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From sean at rogue-research.com Thu May 2 15:11:15 2019 From: sean at rogue-research.com (Sean McBride) Date: Thu, 2 May 2019 15:11:15 -0400 Subject: [ITK] [ITK-users] Create STL file from DICOM 2D series of images In-Reply-To: <1556814327051-0.post@n2.nabble.com> References: <1556795353337-0.post@n2.nabble.com> <1556814327051-0.post@n2.nabble.com> Message-ID: <20190502191115.175328891@mail.rogue-research.com> On Thu, 2 May 2019 09:25:27 -0700, kanmaniguna said: >This is my college assignment. DICOM files are a structured grid: STL files are a triangle mesh: You'll need to research how to make the latter from the former. Cheers, -- ____________________________________________________________ Sean McBride, B. Eng sean at rogue-research.com Rogue Research www.rogue-research.com Mac Software Developer Montr?al, Qu?bec, Canada The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From srbn.ghosh99 at gmail.com Tue May 7 14:34:20 2019 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Tue, 7 May 2019 11:34:20 -0700 (MST) Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices Message-ID: <1557254060777-0.post@n2.nabble.com> Hello Everyone, I am trying to extract 2D slices from a 3d Image volume. I was able to do that using ImageReadExtractWrite.cxx. But when I see the 2D slices, they are distorted. They do not look like the 2d original 2D slices from where 3D volume created. Is there any other way to get the original 3D slices? Thank You -- Sent from: http://itk-insight-users.2283740.n2.nabble.com/ The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From dzenanz at gmail.com Tue May 7 15:46:03 2019 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 7 May 2019 15:46:03 -0400 Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: <1557254060777-0.post@n2.nabble.com> References: <1557254060777-0.post@n2.nabble.com> Message-ID: Hi Shrabani, you should try different direction matrix collapse strategies: https://itk.org/Doxygen/html/classitk_1_1ExtractImageFilter.html#a5b3bcfa552d8ad7cf509e32209aadc13 Regards, D?enan On Tue, May 7, 2019 at 2:43 PM Shrabani Ghosh wrote: > Hello Everyone, > > I am trying to extract 2D slices from a 3d Image volume. I was able to do > that using ImageReadExtractWrite.cxx. But when I see the 2D slices, they > are > distorted. They do not look like the 2d original 2D slices from where 3D > volume created. Is there any other way to get the original 3D slices? > > Thank You > > > > -- > Sent from: http://itk-insight-users.2283740.n2.nabble.com/ > The ITK community is transitioning from this mailing list to > discourse.itk.org. Please join us there! > ________________________________ > 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: > https://itk.org/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From srbn.ghosh99 at gmail.com Tue May 7 18:35:54 2019 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Tue, 7 May 2019 15:35:54 -0700 (MST) Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: References: <1557254060777-0.post@n2.nabble.com> Message-ID: <1557268554107-0.post@n2.nabble.com> Can you recommend any similar example which has used this function? -- Sent from: http://itk-insight-users.2283740.n2.nabble.com/ The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From dzenanz at gmail.com Tue May 7 21:14:48 2019 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Tue, 7 May 2019 21:14:48 -0400 Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: <1557268554107-0.post@n2.nabble.com> References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> Message-ID: How about this one: https://itk.org/Doxygen/html/SphinxExamples_2src_2Filtering_2ImageGrid_2ProcessA2DSliceOfA3DImage_2Code_8cxx-example.html#_a4 On Tue, May 7, 2019 at 6:35 PM Shrabani Ghosh wrote: > Can you recommend any similar example which has used this function? > > > > -- > Sent from: http://itk-insight-users.2283740.n2.nabble.com/ > The ITK community is transitioning from this mailing list to > discourse.itk.org. Please join us there! > ________________________________ > 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: > https://itk.org/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From srbn.ghosh99 at gmail.com Wed May 8 02:17:02 2019 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Tue, 7 May 2019 23:17:02 -0700 (MST) Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> Message-ID: <1557296222115-0.post@n2.nabble.com> I have tried different direction matrix collapse strategies. But still, I am getting the same. The slices are coming out like this. -- Sent from: http://itk-insight-users.2283740.n2.nabble.com/ The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From dzenanz at gmail.com Wed May 8 10:18:56 2019 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 8 May 2019 10:18:56 -0400 Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: <1557296222115-0.post@n2.nabble.com> References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> <1557296222115-0.post@n2.nabble.com> Message-ID: You need to use a different pixel type. You might be using char, and needing to use unsigned char or short. On Wed, May 8, 2019 at 2:17 AM Shrabani Ghosh wrote: > I have tried different direction matrix collapse strategies. But still, I > am > getting the same. The slices are coming out like this. > > > > > > > -- > Sent from: http://itk-insight-users.2283740.n2.nabble.com/ > The ITK community is transitioning from this mailing list to > discourse.itk.org. Please join us there! > ________________________________ > 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: > https://itk.org/mailman/listinfo/insight-users > The ITK community is transitioning from this mailing list to > discourse.itk.org. Please join us there! > ________________________________________ > Community mailing list > Community at itk.org > https://itk.org/mailman/listinfo/community > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From srbn.ghosh99 at gmail.com Wed May 8 11:44:14 2019 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Wed, 8 May 2019 11:44:14 -0400 Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> <1557296222115-0.post@n2.nabble.com> Message-ID: I am using unsigned char as output pixel and signed short as input pixel. On Wed, May 8, 2019 at 10:19 AM D?enan Zuki? wrote: > You need to use a different pixel type. You might be using char, and > needing to use unsigned char or short. > > On Wed, May 8, 2019 at 2:17 AM Shrabani Ghosh > wrote: > >> I have tried different direction matrix collapse strategies. But still, I >> am >> getting the same. The slices are coming out like this. >> >> >> >> >> >> >> -- >> Sent from: http://itk-insight-users.2283740.n2.nabble.com/ >> The ITK community is transitioning from this mailing list to >> discourse.itk.org. Please join us there! >> ________________________________ >> 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: >> https://itk.org/mailman/listinfo/insight-users >> The ITK community is transitioning from this mailing list to >> discourse.itk.org. Please join us there! >> ________________________________________ >> Community mailing list >> Community at itk.org >> https://itk.org/mailman/listinfo/community >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From dzenanz at gmail.com Wed May 8 11:48:45 2019 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 8 May 2019 11:48:45 -0400 Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> <1557296222115-0.post@n2.nabble.com> Message-ID: If the input and output pixel types are different, extract filter does simple casting. That causes the effect you have observed. You need to use RescaleIntensityImageFilter either before or after the extract. Have the extract filter use the same input and output pixel type. On Wed, May 8, 2019 at 11:44 AM Shrabani Ghosh wrote: > I am using unsigned char as output pixel and signed short as input > pixel. > > On Wed, May 8, 2019 at 10:19 AM D?enan Zuki? wrote: > >> You need to use a different pixel type. You might be using char, and >> needing to use unsigned char or short. >> >> On Wed, May 8, 2019 at 2:17 AM Shrabani Ghosh >> wrote: >> >>> I have tried different direction matrix collapse strategies. But still, >>> I am >>> getting the same. The slices are coming out like this. >>> >>> >>> >>> >>> >>> >>> >>> -- >>> Sent from: http://itk-insight-users.2283740.n2.nabble.com/ >>> The ITK community is transitioning from this mailing list to >>> discourse.itk.org. Please join us there! >>> ________________________________ >>> 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: >>> https://itk.org/mailman/listinfo/insight-users >>> The ITK community is transitioning from this mailing list to >>> discourse.itk.org. Please join us there! >>> ________________________________________ >>> Community mailing list >>> Community at itk.org >>> https://itk.org/mailman/listinfo/community >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From srbn.ghosh99 at gmail.com Wed May 8 13:54:08 2019 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Wed, 8 May 2019 10:54:08 -0700 (MST) Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> <1557296222115-0.post@n2.nabble.com> Message-ID: <1557338048860-0.post@n2.nabble.com> I did it like this and I am getting images like this now. int main( int argc, char ** argv ) { //typedef signed short InputPixelType; /*typedef unsigned char InputPixelType; typedef unsigned char OutputPixelType;*/ typedef signed short InputPixelType; typedef unsigned char OutputPixelType; typedef itk::Image< InputPixelType, 3 > InputImageType; typedef itk::Image< OutputPixelType, 2 > OutputImageType; typedef itk::ImageFileReader< InputImageType > ReaderType; typedef itk::ImageFileWriter< OutputImageType > WriterType; const char * inputFilename = "G:/My Drive/BMES2019/New folder/subject1.nii"; { int i = 1; std::string str="input//"; std::string s1="slice"; std::string s2 = std::to_string(i); std::string s3=".png"; std::string s4=str+s1+s2+s3; const char *mycharp = s4.c_str(); const char * outputFilename = mycharp; ReaderType::Pointer reader = ReaderType::New(); WriterType::Pointer writer = WriterType::New(); reader->SetFileName( inputFilename ); writer->SetFileName( outputFilename ); typedef itk::RescaleIntensityImageFilter< InputImageType, InputImageType > RescaleFilterType; RescaleFilterType::Pointer rescalefilter = RescaleFilterType::New(); rescalefilter->SetInput( reader->GetOutput() ); typedef itk::ExtractImageFilter< InputImageType, OutputImageType > FilterType; FilterType::Pointer filter = FilterType::New(); filter->InPlaceOn(); filter->SetDirectionCollapseToSubmatrix(); reader->UpdateOutputInformation(); InputImageType::RegionType inputRegion = reader->GetOutput()->GetLargestPossibleRegion(); InputImageType::SizeType size = inputRegion.GetSize(); size[2] = 0; InputImageType::IndexType start = inputRegion.GetIndex(); const unsigned int sliceNumber = stoi(s2);//atoi(argv[3]); start[2] = sliceNumber; InputImageType::RegionType desiredRegion; desiredRegion.SetSize( size ); desiredRegion.SetIndex( start ); filter->SetExtractionRegion( desiredRegion ); filter->SetInput( rescalefilter->GetOutput() ); writer->SetInput( filter->GetOutput() ); try { writer->Update(); } catch( itk::ExceptionObject & err ) { std::cerr << "ExceptionObject caught !" << std::endl; std::cerr << err << std::endl; getchar(); return EXIT_FAILURE; } } return EXIT_SUCCESS; } -- Sent from: http://itk-insight-users.2283740.n2.nabble.com/ The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From dzenanz at gmail.com Wed May 8 14:17:20 2019 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Wed, 8 May 2019 14:17:20 -0400 Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: <1557338048860-0.post@n2.nabble.com> References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> <1557296222115-0.post@n2.nabble.com> <1557338048860-0.post@n2.nabble.com> Message-ID: Definitions of RescaleFilterType and FilterType should be like this: typedef itk::RescaleIntensityImageFilter< InputImageType, OutputImageType > RescaleFilterType; typedef itk::ExtractImageFilter< OutputImageType, OutputImageType > FilterType; On Wed, May 8, 2019 at 1:54 PM Shrabani Ghosh wrote: > I did it like this and I am getting images like this now. > > > > > int main( int argc, char ** argv ) > { > > //typedef signed short InputPixelType; > /*typedef unsigned char InputPixelType; > typedef unsigned char OutputPixelType;*/ > typedef signed short InputPixelType; > typedef unsigned char OutputPixelType; > typedef itk::Image< InputPixelType, 3 > InputImageType; > typedef itk::Image< OutputPixelType, 2 > OutputImageType; > typedef itk::ImageFileReader< InputImageType > ReaderType; > typedef itk::ImageFileWriter< OutputImageType > WriterType; > const char * inputFilename = "G:/My Drive/BMES2019/New > folder/subject1.nii"; > > { > int i = 1; > > std::string str="input//"; > std::string s1="slice"; > std::string s2 = std::to_string(i); > std::string s3=".png"; > std::string s4=str+s1+s2+s3; > const char *mycharp = s4.c_str(); > > const char * outputFilename = mycharp; > > ReaderType::Pointer reader = ReaderType::New(); > WriterType::Pointer writer = WriterType::New(); > > reader->SetFileName( inputFilename ); > writer->SetFileName( outputFilename ); > > typedef itk::RescaleIntensityImageFilter< InputImageType, InputImageType > > RescaleFilterType; > RescaleFilterType::Pointer rescalefilter = RescaleFilterType::New(); > rescalefilter->SetInput( reader->GetOutput() ); > > typedef itk::ExtractImageFilter< InputImageType, > OutputImageType > FilterType; > FilterType::Pointer filter = FilterType::New(); > filter->InPlaceOn(); > filter->SetDirectionCollapseToSubmatrix(); > reader->UpdateOutputInformation(); > InputImageType::RegionType inputRegion = > reader->GetOutput()->GetLargestPossibleRegion(); > > InputImageType::SizeType size = inputRegion.GetSize(); > size[2] = 0; > > InputImageType::IndexType start = inputRegion.GetIndex(); > const unsigned int sliceNumber = stoi(s2);//atoi(argv[3]); > start[2] = sliceNumber; > > InputImageType::RegionType desiredRegion; > desiredRegion.SetSize( size ); > desiredRegion.SetIndex( start ); > > filter->SetExtractionRegion( desiredRegion ); > > filter->SetInput( rescalefilter->GetOutput() ); > writer->SetInput( filter->GetOutput() ); > try > { > writer->Update(); > } > catch( itk::ExceptionObject & err ) > { > std::cerr << "ExceptionObject caught !" << std::endl; > std::cerr << err << std::endl; > getchar(); > return EXIT_FAILURE; > } > } > return EXIT_SUCCESS; > } > > > > -- > Sent from: http://itk-insight-users.2283740.n2.nabble.com/ > The ITK community is transitioning from this mailing list to > discourse.itk.org. Please join us there! > ________________________________ > 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: > https://itk.org/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From srbn.ghosh99 at gmail.com Wed May 8 20:13:00 2019 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Wed, 8 May 2019 17:13:00 -0700 (MST) Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> <1557296222115-0.post@n2.nabble.com> <1557338048860-0.post@n2.nabble.com> Message-ID: <1557360780373-0.post@n2.nabble.com> I tried based on your recommendation. But still could not make it. Any other suggestions? -- Sent from: http://itk-insight-users.2283740.n2.nabble.com/ The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From dzenanz at gmail.com Thu May 9 08:29:27 2019 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Thu, 9 May 2019 08:29:27 -0400 Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: <1557360780373-0.post@n2.nabble.com> References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> <1557296222115-0.post@n2.nabble.com> <1557338048860-0.post@n2.nabble.com> <1557360780373-0.post@n2.nabble.com> Message-ID: How does the output look like now? On Wed, May 8, 2019 at 8:13 PM Shrabani Ghosh wrote: > I tried based on your recommendation. But still could not make it. Any > other > suggestions? > > > > > > > > -- > Sent from: http://itk-insight-users.2283740.n2.nabble.com/ > The ITK community is transitioning from this mailing list to > discourse.itk.org. Please join us there! > ________________________________ > 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: > https://itk.org/mailman/listinfo/insight-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From srbn.ghosh99 at gmail.com Thu May 9 12:49:03 2019 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Thu, 9 May 2019 12:49:03 -0400 Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> <1557296222115-0.post@n2.nabble.com> <1557338048860-0.post@n2.nabble.com> <1557360780373-0.post@n2.nabble.com> Message-ID: It's the same in the beginning I got. On Thu, May 9, 2019 at 8:29 AM D?enan Zuki? wrote: > How does the output look like now? > > On Wed, May 8, 2019 at 8:13 PM Shrabani Ghosh > wrote: > >> I tried based on your recommendation. But still could not make it. Any >> other >> suggestions? >> >> >> >> >> >> >> >> -- >> Sent from: http://itk-insight-users.2283740.n2.nabble.com/ >> The ITK community is transitioning from this mailing list to >> discourse.itk.org. Please join us there! >> ________________________________ >> 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: >> https://itk.org/mailman/listinfo/insight-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From dzenanz at gmail.com Thu May 9 12:52:41 2019 From: dzenanz at gmail.com (=?UTF-8?B?RMW+ZW5hbiBadWtpxIc=?=) Date: Thu, 9 May 2019 12:52:41 -0400 Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> <1557296222115-0.post@n2.nabble.com> <1557338048860-0.post@n2.nabble.com> <1557360780373-0.post@n2.nabble.com> Message-ID: Please post this question to the forum . Include the current source code and the output image. If possible, also include a crop or screenshot of the input image. Regards, D?enan On Thu, May 9, 2019 at 12:49 PM Shrabani Ghosh wrote: > It's the same in the beginning I got. > > On Thu, May 9, 2019 at 8:29 AM D?enan Zuki? wrote: > >> How does the output look like now? >> >> On Wed, May 8, 2019 at 8:13 PM Shrabani Ghosh >> wrote: >> >>> I tried based on your recommendation. But still could not make it. Any >>> other >>> suggestions? >>> >>> >>> >>> >>> >>> >>> >>> -- >>> Sent from: http://itk-insight-users.2283740.n2.nabble.com/ >>> The ITK community is transitioning from this mailing list to >>> discourse.itk.org. Please join us there! >>> ________________________________ >>> 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: >>> https://itk.org/mailman/listinfo/insight-users >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From srbn.ghosh99 at gmail.com Thu May 9 13:48:00 2019 From: srbn.ghosh99 at gmail.com (Shrabani Ghosh) Date: Thu, 9 May 2019 13:48:00 -0400 Subject: [ITK] [ITK-users] Image conversion from 3D volume to 2D slices In-Reply-To: References: <1557254060777-0.post@n2.nabble.com> <1557268554107-0.post@n2.nabble.com> <1557296222115-0.post@n2.nabble.com> <1557338048860-0.post@n2.nabble.com> <1557360780373-0.post@n2.nabble.com> Message-ID: Okay, Thank you. I have posted there, On Thu, May 9, 2019 at 12:52 PM D?enan Zuki? wrote: > Please post this question to the forum . > Include the current source code and the output image. If possible, also > include a crop or screenshot of the input image. > > Regards, > D?enan > > On Thu, May 9, 2019 at 12:49 PM Shrabani Ghosh > wrote: > >> It's the same in the beginning I got. >> >> On Thu, May 9, 2019 at 8:29 AM D?enan Zuki? wrote: >> >>> How does the output look like now? >>> >>> On Wed, May 8, 2019 at 8:13 PM Shrabani Ghosh >>> wrote: >>> >>>> I tried based on your recommendation. But still could not make it. Any >>>> other >>>> suggestions? >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> -- >>>> Sent from: http://itk-insight-users.2283740.n2.nabble.com/ >>>> The ITK community is transitioning from this mailing list to >>>> discourse.itk.org. Please join us there! >>>> ________________________________ >>>> 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: >>>> https://itk.org/mailman/listinfo/insight-users >>>> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users From ee18d504 at iittp.ac.in Fri May 24 06:31:10 2019 From: ee18d504 at iittp.ac.in (EE18D504 SINDHURA C) Date: Fri, 24 May 2019 16:01:10 +0530 Subject: [ITK] [ITK-users] Registration - How to save deformation field.? Message-ID: Hi I am executing deformableregistration15.cxx file. I wonder how to save the deformation field? In which format should I save it? I tried mha and mhd format. But it throws an error message. Regards Sindhu -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- The ITK community is transitioning from this mailing list to discourse.itk.org. Please join us there! ________________________________ 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: https://itk.org/mailman/listinfo/insight-users